Author Topic: Minor lisp mod help needed (change color of layers)  (Read 930 times)

0 Members and 1 Guest are viewing this topic.

econnerly

  • Newt
  • Posts: 42
Minor lisp mod help needed (change color of layers)
« on: April 01, 2016, 04:17:17 PM »
I have this code to change layer colors. I am wanting to use it to screen the color of our Xrefs back. It would be nice to be able to select what objects / xrefs to apply this routine to. Currently it does it for all layers in the drawings. See attached file for the full code.

;;;screen layers to 40 percent
(defun c:LS40(/ colLst lay col)
(vl-load-com)
(setq colLst '(
(1 . 41)
(2 . 42)
(3 . 43)
(4 . 44)
(5 . 45)
(6 . 46)
(7 . 47)
(8 . 48)
(9 . 49)
(10 . 41)
(11 . 41)
(12 . 42)
(13 . 43)
(14 . 44)
(15 . 45)
(16 . 46)
(17 . 47)
(18 . 48)
(19 . 49)
(20 . 41)
(21 . 41)
(22 . 42)
(23 . 43)
(24 . 44)
(25 . 45)
(26 . 46)
(27 . 47)
(28 . 48)
(29 . 49)
(30 . 41)
(31 . 41)
(32 . 42)
(33 . 43)
(34 . 44)
(35 . 45)
(36 . 46)
(37 . 47)
(38 . 48)
(39 . 49)
(40 . 41)
(41 . 41)
(42 . 42)
(43 . 43)
(44 . 44)
(45 . 45)
(46 . 46)
(47 . 47)
(48 . 48)
(49 . 49)
(50 . 41)
(51 . 41)
(52 . 42)
(53 . 43)
(54 . 44)
(55 . 45)
(56 . 46)
(57 . 47)
(58 . 48)
(59 . 49)
(60 . 41)
(61 . 41)
(62 . 42)
(63 . 43)
(64 . 44)
(65 . 45)
(66 . 46)
(67 . 47)
(68 . 48)
(69 . 49)
(70 . 41)
(71 . 41)
(72 . 42)
(73 . 43)
(74 . 44)
(75 . 45)
(76 . 46)
(77 . 47)
(78 . 48)
(79 . 49)
(80 . 41)
(81 . 41)
(82 . 42)
(83 . 43)
(84 . 44)
(85 . 45)
(86 . 46)
(87 . 47)
(88 . 48)
(89 . 49)
(90 . 41)
(91 . 41)
(92 . 42)
(93 . 43)
(94 . 44)
(95 . 45)
(96 . 46)
(97 . 47)
(98 . 48)
(99 . 49)
(100 . 41)
(101 . 41)
(102 . 42)
(103 . 43)
(104 . 44)
(105 . 45)
(106 . 46)
(107 . 47)
(108 . 48)
(109 . 49)
(110 . 41)
(111 . 41)
(112 . 42)
(113 . 43)
(114 . 44)
(115 . 45)
(116 . 46)
(117 . 47)
(118 . 48)
(119 . 49)
(120 . 41)
(121 . 41)
(122 . 42)
(123 . 43)
(124 . 44)
(125 . 45)
(126 . 46)
(127 . 47)
(128 . 48)
(129 . 49)
(130 . 41)
(131 . 41)
(132 . 42)
(133 . 43)
(134 . 44)
(135 . 45)
(136 . 46)
(137 . 47)
(138 . 48)
(139 . 49)
(140 . 41)
(141 . 41)
(142 . 42)
(143 . 43)
(144 . 44)
(145 . 45)
(146 . 46)
(147 . 47)
(148 . 48)
(149 . 49)
(150 . 41)
(151 . 41)
(152 . 42)
(153 . 43)
(154 . 44)
(155 . 45)
(156 . 46)
(157 . 47)
(158 . 48)
(159 . 49)
(160 . 41)
(161 . 41)
(162 . 42)
(163 . 43)
(164 . 44)
(165 . 45)
(166 . 46)
(167 . 47)
(168 . 48)
(169 . 49)
(170 . 41)
(171 . 41)
(172 . 42)
(173 . 43)
(174 . 44)
(175 . 45)
(176 . 46)
(177 . 47)
(178 . 48)
(179 . 49)
(180 . 41)
(181 . 181)
(182 . 182)
(183 . 183)
(184 . 184)
(185 . 45)
(186 . 186)
(187 . 47)
(188 . 188)
(189 . 49)
(190 . 41)
(191 . 41)
(192 . 42)
(193 . 43)
(194 . 44)
(195 . 45)
(196 . 46)
(197 . 47)
(198 . 198)
(199 . 49)
(200 . 41)
(201 . 41)
(202 . 42)
(203 . 43)
(204 . 44)
(205 . 45)
(206 . 46)
(207 . 47)
(208 . 48)
(209 . 49)
(210 . 41)
(211 . 41)
(212 . 42)
(213 . 43)
(214 . 44)
(215 . 45)
(216 . 46)
(217 . 47)
(218 . 48)
(219 . 49)
(220 . 41)
(221 . 41)
(222 . 42)
(223 . 43)
(224 . 44)
(225 . 45)
(226 . 46)
(227 . 47)
(228 . 48)
(229 . 49)
(230 . 41)
(231 . 41)
(232 . 42)
(233 . 43)
(234 . 44)
(235 . 45)
(236 . 46)
(237 . 47)
(238 . 48)
(239 . 49)
(240 . 41)
(241 . 241)
(242 . 42)
(243 . 43)
(244 . 44)
(245 . 45)
(246 . 46)
(247 . 47)
(248 . 48)
(249 . 249)
(250 . 250)
(251 . 251)
(252 . 252)
(253 . 253)
(254 . 254)
(255 . 255)
))
(vlax-for l (vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)))
(setq lay (cons l lay)))
(foreach layer lay
(if (setq col (assoc (vla-get-color layer) colLst))
(vla-put-color layer (cdr col))))
(princ))

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Minor lisp mod help needed (change color of layers)
« Reply #1 on: April 02, 2016, 04:30:23 AM »
Why don't you use XDWGFADECTL?

econnerly

  • Newt
  • Posts: 42
Re: Minor lisp mod help needed (change color of layers)
« Reply #2 on: April 05, 2016, 12:09:04 PM »
I can't used XREFFADECTL because I want the printed linework to be screened as well.