rcb007 Posted November 22, 2021 Posted November 22, 2021 Does anyone have a method to isolate blocks or objects, that have nested layers within the blocks? I have blocks that have [for example (Layer A, Layer C, Layer 1, Layer 10)] contained in the block. The block resides on master layer (Layer Blocks). I was hoping to isolate the (Layers Block) by selecting the object and it would also isolate the other layers with it. Is that possible by any chance? Hopefully if it can do that, it would be easily to unisolate it as well. Quote
ronjonp Posted November 22, 2021 Posted November 22, 2021 (edited) Try this: (defun c:foo (/ e k l n) ;; RJP » 2021-11-22 (layerstate-restore (setq k "RJP-NLAYISO") nil 2) (while (setq e (nentsel "\nSelect objects to isolate: ")) (foreach x (append (list (car e)) (cadddr e)) (or (vl-position (setq n (cdr (assoc 8 (entget x)))) l) (setq l (cons n l))) ) ) (if l (progn (setvar 'cmdecho 0) (layerstate-save k 2 nil) (command "_.layer" "_Freeze" "*" "") (command "_.layer" "_Thaw" (apply 'strcat (mapcar '(lambda (x) (strcat x ",")) l)) "") (setvar 'cmdecho 1) ) ) (princ) ) Edited November 22, 2021 by ronjonp Quote
rcb007 Posted November 23, 2021 Author Posted November 23, 2021 Works Great Ronjon! Hate to ask this, anyway to "unfoo"? If not, I can still make this work. thank you again. Quote
ronjonp Posted November 23, 2021 Posted November 23, 2021 2 hours ago, rcb007 said: Works Great Ronjon! Hate to ask this, anyway to "unfoo"? If not, I can still make this work. thank you again. (defun c:unfoo nil (layerstate-restore "RJP-NLAYISO" nil 2)) 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.