Jump to content

MULTIPLE LAYERS TURNING OFF BY SELECTING MULTIPLE ELEMENTS BY CROSS WINDOW


tnvsb

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites



(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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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