Lisp needed

Aug 29, 2005 6 Replies

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) )

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required