Lisp needed

Hi
I'm looking for lisp that lock all layer except the picked entity, next
unlock layers back.
thanks
Reply to
jazu
Loading thread data ...
express tools has a similar option. go to layer manager & lock all, then pick on the entity you which to unlock the layer of.
Reply to
Longshot
this is the way im doing, so I want faster metod
Reply to
jazu
This will do what you want. Use layerp to return layers to their previous state.
(defun c:layerlock ( / ename layname) (while (not (setq ename (entsel "\nSelect object on desired layer: ")))) (setq ename (car ename)) (setq layname (cdr (assoc 8 (entget ename)))) (command ".layer" "s" layname "lo" "*" "U" layname "") (princ (strcat "\nAll layers locked except " layname)) (princ) )
Reply to
Jim Claypool
thanks Is it possible unlocking some layers by picking them? Say I have some layers. Using ur lisp I lock all except one. Next I want to unlock just one layer by picking it. jazu
Reply to
jazu
There is a Bonus/Express tool to do this, which you may have. Used to be
"LAYULK"
Reply to
Michael Bulatovich
Basically the same thing.
(defun c:layerunlock ( / ename layname) (while (not (setq ename (entsel "\nSelect object on desired layer: ")))) (setq ename (car ename)) (setq layname (cdr (assoc 8 (entget ename)))) (command ".layer" "u" layname "") (princ (strcat "\nLayer " layname " is unlocked")) (princ) )
Reply to
Jim Claypool

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.