Delete all objects on a frozen layer

Delete all objects on a frozen layer

angiegauthier
Enthusiast Enthusiast
7,615 Views
31 Replies
Message 1 of 32

Delete all objects on a frozen layer

angiegauthier
Enthusiast
Enthusiast

Hi Everyone!

 

Can someone tell me how (or if it's possible) with Lisp to delete anything that is on a frozen layer?

 

Thanks 

Angie

0 Likes
Accepted solutions (1)
7,616 Views
31 Replies
Replies (31)
Message 21 of 32

ВeekeeCZ
Consultant
Consultant

@FCort wrote:
Thank you again, but it doesn’t delete any frozen layer. I would like something similar like LAYDEL, but that allows select many frozen-off layers at once (selecting the frozen-off layers from the layer properties manager will be better). To use LAYDEL the layer has to be active on, but in my case I want to eliminate the ones that are not active/off. ( I have a lot of layers in a drawing, so, if I turn on all the layers, it is going to be hard to find the ones that I want to eliminate.)

You don't need a special routine for that. Use MERGE command from LAYER PROPERTIES DIALOG and merge all the layers but e.g. the first one into that one layer. Then use LAYDEL for it. Even if you'll do that 30 times a day, it's still real quick.

 

And tomorrow ask the ADSK staff why this is not build in Layer Properties Dialog. I'll must get your answer... since is The Answer Day!

0 Likes
Message 22 of 32

FCort
Collaborator
Collaborator

I purged before, the frozen layers and objects still exist. 

 

Nothing was erased.

 

The version is AutoCAD 2015

0 Likes
Message 23 of 32

FCort
Collaborator
Collaborator

Thank you BeeKeeCZ !

 

Your suggestion is a good workaround; unfortunately my file has a lot of layers, and AutoCAD almost froze when using the merge tool in the layer properties manager (it took 25 min. to merge).

 

It will be useful to have LAYDEL in the layers properties manager window, so we can sort the layers and select many at once.

0 Likes
Message 24 of 32

Kent1Cooper
Consultant
Consultant

@FCort wrote:

I purged before, the frozen layers and objects still exist. 

 

Nothing was erased.

 

The version is AutoCAD 2015


I don't know what to suggest.  The code in Post 15 works for me [again, removing all objects on those Layers, but not yet Purging the Layers] in both AutoCAD 2004 and 2016.

 

Are you sure the Layers in question are not locked?  Did you notice the change in the command name from the earlier DFL?

Kent Cooper, AIA
0 Likes
Message 25 of 32

FCort
Collaborator
Collaborator

All the layers were no locked.

 

None of the layers and objects were deleted.

 

Thank you for the effort.

 

dfol.JPG

 

0 Likes
Message 26 of 32

Kent1Cooper
Consultant
Consultant

@FCort wrote:

.... 

None of the layers and objects were deleted.

.... 

dfol.JPG

 


The 'nil' there doesn't mean it didn't do anything.  If you want it to not show that, you can add a line to the code:
....

  ); if
  (princ); "exit quietly" [read about it in Help]
); defun

....

 

Again, for me, even without suppressing that 'nil' return, it does remove all objects from such Layers.  I thaw the Layers and/or turn them back on and Regenerate, and none of the things I had drawn on them are still there.  We could work on getting it to Purge the Layers, too, but first I'd like to solve the problem that it doesn't remove the objects for you, if it really doesn't.  But I admit, I don't have any idea where to look for a solution, since I can't duplicate that problem....

Kent Cooper, AIA
0 Likes
Message 27 of 32

hmsilva
Mentor
Mentor

@FCort wrote:

All the layers were no locked.

None of the layers and objects were deleted.

 ...


Hi FCort,

could you please, share with us a sample dwg with with a few objects and layers?

 

Henrique

EESignature

0 Likes
Message 28 of 32

F.Camargo
Advisor
Advisor

Hi friends

 

I don't understand why isn't working for my file.

 

I'd like to deleting all frozen layers in my drawing.

 

Could you help me, please?

 

File attached

 

Thanks

Fabricio

 

 

0 Likes
Message 29 of 32

Kent1Cooper
Consultant
Consultant

It doesn't remove the Layers, just the things drawn on them -- use PURGE or LAYDEL instead.  It looks like there's nothing on any of them, anyway -- that is, I thawed and unlocked and turned on all Layers, and REGENerated the drawing, and it didn't look any different -- so you should be able to Purge them.

Kent Cooper, AIA
Message 30 of 32

F.Camargo
Advisor
Advisor

Thanks for replay,

 

Can't I use any code to delete all frozen layer in my drawing?

 

I've tried purge command, but ins't deleting the layers.

Laydel command, worked fine. But I have to delete one by one objects.

 

Thanks

Fabricio

 

0 Likes
Message 31 of 32

Kent1Cooper
Consultant
Consultant

@F.Camargo wrote:

.... 

I've tried purge command, but ins't deleting the layers.

Laydel command, worked fine. But I have to delete one by one objects.

.... 


I couldn't Purge them, either, after running my routine for removing everything on them [I didn't try the others].  I suspect that means you have something like elements on those Layers that are included in Block definitions.  Laydel will remove even those, but merely removing everything drawn on those Layers will not free such Layers up to be Purged.  I'll leave exploration of that possibility to you.

Kent Cooper, AIA
0 Likes
Message 32 of 32

F.Camargo
Advisor
Advisor

@Kent1Cooper wrote:

@F.Camargo wrote:

.... 

I've tried purge command, but ins't deleting the layers.

Laydel command, worked fine. But I have to delete one by one objects.

.... 


I couldn't Purge them, either, after running my routine for removing everything on them [I didn't try the others].  I suspect that means you have something like elements on those Layers that are included in Block definitions.  Laydel will remove even those, but merely removing everything drawn on those Layers will not free such Layers up to be Purged.  I'll leave exploration of that possibility to you.


There are some layers from autocad civil 3D.

I was using a template from C3D.

 

maybe could be this causing the problem.

 

Fabricio

 

0 Likes