Jump to content

MULTIPLE LAYERS TURNING OFF BY SELECTING MULTIPLE ELEMENTS BY CROSS WINDOW


Recommended Posts

Posted

Hi helpers,

I need a lisp for that can turn off multiple layers, by selecting multiple elements in different layers.

Thanks,

T.Brahmanandam.

Posted (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 by gS7
Posted

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.

Posted (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 by gS7
updated code
Posted

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.

Posted

Hi TNVSB i have updated code please copy again the code and give a try

 

Thank you

  • Like 1

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...