@Anonymous wrote:
.... We have an xref with multiple layers that have different prefixes (job numbers) but always have "(Master-E) New" or "(Master-E) EXR" in it. Is there a way to make a lisp very similar to this that just changes the color of those layers?
If you want the same color for both categories, use wildcard *'s at both ends of those substrings if there might be more Layer name after the target part, and comma-delimited multiple Layer names:
(defun C:LCME (/ col); = Layer Color by Master-E
(setq col (getstring "\nColor for (Master-E) New and (Master-E) EXR Layers: "))
(command "_.layer" "_color" col "*(Master-E) New*,*(Master-E) EXR*" "")
); defun
or a version without any variables:
(defun C:LCME (); = Layer Color by Master-E
(command "_.layer"
"_color" (getstring "\nColor for (Master-E) New and (Master-E) EXR Layers: ")
"*(Master-E) New*,*(Master-E) EXR*"
""
); command
); defun
If you want different colors for the two categories, change the names, and include * at the ends:
(defun C:LCME (/ colN colE); = Layer Color by Master-E
(setq
colN (getstring "\nColor for (Master-E) New Layers: ")
colE (getstring "\nColor for (Master-E) EXR Layers: ")
); setq
(command "_.layer"
"_color" colN "*(Master-E) New*"
"_color" colE "*(Master-E) EXR*"
""
); command
); defun
or just:
(defun C:LCME (); = Layer Color by Master-E
(command "_.layer"
"_color" (getstring "\nColor for (Master-E) New Layers: ") "*(Master-E) New*"
"_color" (getstring "\nColor for (Master-E) EXR Layers: ") "*(Master-E) EXR*"
""
); command
); defun
Either could be made to be not case-sensitive, if needed, and/or could be made to verify valid color input, and probably some more things.
Kent Cooper, AIA