;;; CADALYST 04/08 www.cadalyst.com/code
;;; Tip 2278: XR-LAYCOL.LSP Change Xref Layer Color (c) 2008 Raymnond Rizkallah
;;;====================================================================
;;; [C:XRC] Function to change LAYER COLOR, extracting Layers name
;;; by picking objects.
;;;
;;; By Raymond RIZKALLAH - Oct./2007
;;;====================================================================
(defun C:XRC ()
(setq laylst nil)
(while
(setq entsll
(nentsel "\n Select object on the layer to be COLORED: ")
)
(setq laynam (cdr (assoc 8 (entget (car entsll)))))
(if (null laylst)
(setq laylst laynam)
(setq laylst (strcat laylst "," laynam))
)
(prompt (strcat "\n {" laylst "}"))
)
;end while
(if laylst
(progn
(setq lay-col (getint "\nNew Layers Color: "))
(command "layer" "c" lay-col laylst "")
)
)
;end if
(princ)
)
;end function
;;;====================================================================
(PROMPT "\n Use [C:XRC] to change XREF's layer COLOR.")
(PRINC)
(defun C:XRC ()
(setq laylst nil)
(while
(setq entsll
(nentsel
"\n Select object on the layer to be COLORED: ")
)
....