Erase at once selected layers that are frozen or off

Erase at once selected layers that are frozen or off

FCort
Collaborator Collaborator
3,861 Views
6 Replies
Message 1 of 7

Erase at once selected layers that are frozen or off

FCort
Collaborator
Collaborator

Hi,

 

Please indicate how to erase selected (or all) layers that are frozen and/or off (also erase all the objects that have these layers).  

 

It could be better if it allow to select which frozen layers will be eliminated.

 

Is there any way to use LAYDEL tool by selecting many frozen layers from the layers properties manager?

 

Thanks in advance.

0 Likes
3,862 Views
6 Replies
Replies (6)
Message 2 of 7

3wood
Advisor
Advisor

You can try EXPLODEALL, tick the setting below.

Capture.jpg

If you would like to remain objects on any frozen layer, just thaw it before using EXPLODEALL.

0 Likes
Message 3 of 7

FCort
Collaborator
Collaborator
Thank you, but after running the explodeall a message comes out, select objects to explode.
What I need is erase all frozen off (no visible) layers at once.
0 Likes
Message 4 of 7

dbroad
Mentor
Mentor

The laydel command can delete any layers (frozen, off, or locked) using the name option.  You just need to select the layers to delete.

 

If you need a routine to make the selection for you, this could be a start.  Instead of starting with a given layer name, you would need to loop as shown and to preselect the off and frozen layers.  

(defun c:test ()
  (setq doc (vla-get-activedocument(vlax-get-acad-object)))
  (setq lays (vla-get-layers doc))
  (setq layn (vla-get-name(vla-item lays "layER4")))
  (setq lay (vla-item lays layn))
  (vla-put-lock lay :vlax-false)
  (vla-put-layeron lay :vlax-true)
  (vla-put-freeze lay :vlax-false)
  (vlax-for n
	    (vla-get-blocks doc)
	    (vlax-for m n
	      (if (= layn (vla-get-layer m))
		(vla-delete m)
		)))
  (vla-delete (vla-item lays layn))
  )

I did not localize anything.  This is concept only, AS IS.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 5 of 7

FCort
Collaborator
Collaborator

Thank you dbroad,

 

But, how can preselect layers that are off and frozen?

 

I need to erase many frozen-off layers at once (included the objects that belongs to that layers).

0 Likes
Message 6 of 7

dbroad
Mentor
Mentor

Just checking.  So you have no ability to use program LISP?  If I get some time this week, I will complete it.  If you or someone else can add the layer list part, please do so.  There is another thread today that is extremely similar.  Check that out too.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 7 of 7

FCort
Collaborator
Collaborator

Thank you again dbroad,

 

I would like to learn LISP, for now there is a good work around for this requirement. (from BeeKeeCZ: using the merge tool in the layer properties manager, then LAYDEL).

 

http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/delete-all-objects-on-a-frozen-layer/...

 

0 Likes