tnvsb Posted September 29, 2018 Posted September 29, 2018 Hi helpers, I need a lisp for that can turn off multiple layers, by selecting multiple elements in different layers. Thanks, T.Brahmanandam. Quote
gS7 Posted September 29, 2018 Posted September 29, 2018 (edited) Try Layiso command change setting to Lock and fade to OFF Then u can turn off multiple layers by selecting multiple objects (elements) Edited September 29, 2018 by gS7 Quote
tnvsb Posted September 29, 2018 Author Posted September 29, 2018 You reached my point but that works quite opposite to my requirement. Layiso can only isolate the layers from others and it turns off other layers. But my requirement is to turn off selected element layers and remaining layers to be in same state. Quote
gS7 Posted September 29, 2018 Posted September 29, 2018 (edited) (defun c:test (/ ss turnoff doc snm laynames) (vl-load-com) (if (setq ss (ssget ":L")) (progn (defun Turnoff (name d / Layers Lay) (setq layers (vla-get-layers d)) (setq lay (vla-item layers name)) (vla-put-layeron lay :vlax-false) ) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (repeat (setq i (sslength ss)) (setq snm (ssname ss (setq i (1- i)))) (setq laynames (cdr (assoc 8 (entget snm)))) (if (/= (getvar 'clayer) laynames) (Turnoff laynames doc) ) ) ) ) (princ) ) Try this code Edited September 29, 2018 by gS7 updated code Quote
tnvsb Posted September 29, 2018 Author Posted September 29, 2018 Dear Sir, I am getting the error code as below: Command: TEST Select objects: Specify opposite corner: 2 found Select objects: ; error: no function definition: \VLA-GET-ACTIVEDOCUMENT Please help. Quote
gS7 Posted September 29, 2018 Posted September 29, 2018 Hi TNVSB i have updated code please copy again the code and give a try Thank you 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.