Hi I'm looking for lisp that lock all layer except the picked entity, next unlock layers back. thanks
- posted
18 years ago
Hi I'm looking for lisp that lock all layer except the picked entity, next unlock layers back. thanks
express tools has a similar option. go to layer manager & lock all, then pick on the entity you which to unlock the layer of.
this is the way im doing, so I want faster metod
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) )
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
There is a Bonus/Express tool to do this, which you may have. Used to be
"LAYULK"
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) )
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.