set layer

Hi all,
I am looking for a Set Layer lisp routine. I would like to be able to click
a layer and the routine to make it current.
Thanks in advance.
Reply to
Philip Russell
Loading thread data ...
If you mean by selecting an object, try ai_molc, the built-in routine.
If you mean by some other method, what exactly do you mean?
Reply to
LSET will do that:
(defun c:lset (/ a2 bw l1 l2) (setvar "CMDECHO" 0) (prompt "Select entity on target layer") (terpri) (setq a2 (entsel)) (setq b2 (entget (car a2))) (setq l1 (assoc 8 b2)) (setq l2 (cdr l1)) (command "layer" "s" l2 "") (princ) )
(I don't have any credits for this thing and don't know who wrote it.)
Reply to
Michael Bulatovich
AutoCAD already has the "Make Object's Layer Current" button which does that. If you want more features, like turning on or thawing a layer and making it current, try the PRO Menu trial version, at the link below.
Reply to
Tim S

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.