How to delete Stubborn layers from AutoCAD drawing

Icons made by Icon Works from www.flaticon.com is licensed by CC BY 3.0

When a drawing is complete you are left with some stubborn layers that won’t delete no matter what you try, even on seemingly empty layers with no object on them if you try PURGE you won’t be able to delete them.

To get rid of these stubborn layers and to clean your drawing from unused layers you can use LAYDEL and LAYMRG commands.

Using these commands you can even delete Defpoints layer but I wont recommend that.

LAYDEL Command:

This command deletes all objects of a layer and purges the layer no matter what you have on that layer. Even the most stubborn layers are also deleted with this command.

To use this command type LAYDEL on command line and press enter, your command line will now show this message.

laydel command

Select object on the target layer from drawing area or alternatively click on [Name] from command line and select layer which you want to delete from list that appears and press enter. Select yes from command line prompt and press enter again to delete selected layer.

If you try to delete a layer which contains an object from a block then it will delete that object too and you are left with a redefined block.

For example if I have a block like the one shown in image below such that red rectangle is on layer which we want to delete then the resulting redefined block after using LAYDEL command will look like image B with rectangle missing from redefined block.

laydel command 1

LAYMRG Command:

You can use this command if you don’t want to delete objects on a particular layer but you do want to purge the layer on which the objects are present.

This command will merge source layer with the target layer such that source layer is purged and objects on source layer are assigned to target layer. All the objects on source layer will acquire layer properties of target layer after using LAYMRG.

Suppose we have two layers layer 1 and layer 2 and we want to move all objects from layer 1 to layer 2 and also we want to purge layer 1, in that case we can use this command.

To start type LAYMRG on command line and press enter. Command line will now show following prompt.

laymrg command

Click on any object of layer 1 from drawing area and then press enter now command line will prompt you to select target layer on which you want to place all objects of layer 1. Click on any object of target layer (Layer 2) and select yes from next prompt.

You will see that all the objects from layer 1 are now moved to layer 2 and the objects will also inherit properties of layer 2 and layer 1 is purged.

In this case too if an object is part of a block then the block will be redefined to take new properties of assigned layer.

Do you have questions related to this tip? Let me know in comments below.

21 comments

  1. This will only happen if the block is deleted and purged from the drawing. A block will come in just like the one present in the drawing, unless you choose to “Redefine” block at insertion. This is also true for any modification you make to a block in Block Editor.

  2. Does the merge command work if someone has placed elements on the offending layer in a block but the block has not been inserted into the drawing?

    1. If your block contains an object which is on a layer which you want to merge with other layer in such a way that block is not present in the drawing then also LAYMRG will remove the layer and replace it with target layer. When you insert the block it will still contain object from deleted layer but now it will be placed on target layer and it will inherit properties of target layer too.

  3. I really enjoy reading your posts although the vast majority is stuff I already know. This is new to me and I can already see that it will be very useful. Thank you and please continue to write.

  4. Another method for this is to use the ERASE command. Start the ERASE command, type “ALL” and then deselect everything in the drawing that you wish to keep. “ENTER” and then review the command line to see how many objects were deleted. Then begin the purge command. This will eliminate any risk of deleting layers that contain needed blocks. Of course, “OOPS” and undo are always there if you see an issue.

    Unless your CAD group requires specific layers, this is what I found to be the most efficient way and quickest way for us to get rid of everything except what’s physically visible on the drawing. And greatly reduces file size. (Customer drawings tend to have years worth of invisible information)

    We typically don’t have any hidden layers or information to retain, so this method is a little case specific.

    1. That seems like a long but safe method of moving with drawing cleanup but I believe it too has its limitations I have observed and probably you too must have observed that many layers are so stubborn that you wont be able to delete them using purge even when they have no visible or hidden entities assigned to them. So I believe for these limited yet crucial scenarios you can try using LAYDEL or LAYMRG.

  5. Hello, be careful with this command if “blocks” are set on the layer to remove there may be loss of information, certainly there is a message but everyone does not read the messages.
    (frenchglish)

  6. Nice tutorial, the LAYMRG command has been very useful for me, sometimes when I have to use elements of one of my drawings with someone else’s I end up with two layers for the same thing like notes or dimensions; maybe one is DIMS and the other is DIMENSIONS, I merge them and cause their dimensions to be on my layer.

Leave a reply