- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a lisp routine I use A LOT, where you pick an object (or multiple objects), then enter the color you want to change the layer(s) to. Works great, a Cadalyst routine, posted at the bottom in case it might help. Problem being, if you want to change say 10 layers, there is no feedback when you pick, so it's hard to tell if you have selected everything you want. It would be better if I entered the desired color first, and it changes on-screen as soon as you pick the object, so you can see what you've changed. The routine wouldn't exit automatically so that you could continue picking objects. Is this possible, or pie in the sky? Thanks!!
;;; CADALYST 04/08 www.cadalyst.com/code
;;; Tip 2278: XR-LAYCOL.LSP Change Xref Layer Color (c) 2008 Raymnond Rizkallah
;;;====================================================================
;;; [C:xrcc] Function to change XREF's 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
(= (getvar "tilemode") 1)
(progn
(if laylst
(progn
(setq lay-col (getint "\nNew Layers Color: "))
(command "layer" "c" lay-col laylst "")
)
)
)
(progn
(if laylst
(progn
(setq lay-col (getint "\nNew Layers Color: "))
(command ".Vplayer" "Color" lay-col laynam "Current" "")
)
)
)
)
(princ)
)
Solved! Go to Solution.