How to delete Stubborn layers from AutoCAD drawing

In an AutoCAD drawing, there are some stubborn layers that won’t purge 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 won’t 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 the command line and press enter, your command line will show this message.

laydel command

Select an object on the layer which you want to delete from drawing area and press Enter then select Yes from command line options and press enter again.

All objects of the selected layer will be deleted and the layer will also be purged. If the layer has no objects then you can select Name option from the command line as shown in the image above and select the layer which you want to delete from the list of layers.

If you delete a layer which contains an object from a block then it will delete that object from block too and the block will be redefined accordingly.

In the example below, I have a block shown in image A below with a rectangle on red layer. If we delete the red layer from the drawing the rectangle from the block will also be deleted and the block will be redefined as shown in the image B below.

cannot delete layer from autocad

As you can see from the example above, it is likely to accidentally delete objects from drawings using this command so always use it with caution.

LAYMRG Command:

You can use this command if you want to delete a layer and also preserve objects on it.

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.

laymrg command

In the example below, we have three geometries on three different layers. let’s assume that we want to merge layer red with layer green so that all objects of the red layer will get shifted to the green layer.

Type LAYMRG on the command line and press enter, click on the red object from the drawing and press enter then click on the green object from the drawing area and press enter again. Select Yes from the options of the command line to accept the changes and exit the command.

You will notice that the red layer will be deleted from the drawing and all objects of the red layer will be transferred to the green layer as shown in the image below.

delete stubborn layers from AutoCAD

In this case too if an object is part of a block then the block will be redefined to take new properties of the assigned layer. Here also try to exercise caution while using this command to avoid accidental loss of data from your drawing.

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

Learn AutoCAD from basics to a professional level with our self-paced online courses.

View Details
View Details
2017-11-30T16:12:05+00:00

About the Author:

I am a mechanical engineer and I have worked with Design, Manufacturing and Training industries but now SourceCAD is my full-time work and I use it to train students all over the world. I also train corporate clients and help them develop the skill set of their workforce. I am Autodesk AutoCAD Certified Professional and an Autodesk expert elite member. I am a regular contributor of AUGI World magazine and apart from SourceCAD I also develop AutoCAD video courses for Pluralsight and other E-Learning businesses.

27 Comments

  1. Ramans May 7, 2018 at 12:23 pm - Reply

    I regularly read your blogs on autocad . They are great source of information. The information given on how to delete stubborn layers from autocad drawing is very useful. Keep sharing such articles.

  2. David April 26, 2018 at 9:12 pm - Reply

    Thank you! Finally straight and to the point, no fussing around.

  3. Szymon April 20, 2018 at 1:35 pm - Reply

    thanks!!!!!!!!!!!!! finally i deleted audi bad layers !!! 🙂

  4. Ikram March 7, 2018 at 12:40 pm - Reply

    Thanks a lot! Jazak Allah

  5. Greg Benson-Shettle December 2, 2017 at 4:47 pm - Reply

    Great tips for layer management, Laydel especially, but as many have said, use it wisely.
    The Lay del command only appears to be in AutoCAD for Windows not AutoCAD for Mac, it is an unknown command, however, similar functionality is available in AutoCAD for Mac by selecting a layer in the layer palette/visor and then do a right click of the mouse. From the popup menu DELETE is available and with this selected 3 options appear,
    1. Delete the layer and its contents.
    2. Delete the layer and move its contents to another layer – With this option, a dialog box opens presenting a list of the layers and you can choose
    3. Don’t delete the layer and its content.

    Handy merging choice on option 2.

    Hope this help the MAC user. Cheers

  6. Tom Walters October 24, 2016 at 9:49 pm - Reply

    Very useful tip. Thanks much!

    • Jaiprakash Pandey October 27, 2016 at 12:46 pm - Reply

      Welcome Tom

  7. Lewis Skiles January 21, 2016 at 7:36 pm - Reply

    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.

  8. John January 21, 2016 at 8:02 am - Reply

    No, the layer will be re-created if the block is inserted.

    • Jaiprakash Pandey January 24, 2017 at 7:35 pm - Reply

      In both of the cases the Layer will completely disappear from the drawing and the blocks will be redefined. If you have used LAYDEL then the redefined block will not have object of the purged layer but if you have used LAYMRG then the block object will change layer and inherit properties of newly assigned layer.

      Also inserting a new instance of block will only insert a redefined block in either of the cases.

  9. Mike n @lanta January 21, 2016 at 2:05 am - Reply

    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?

    • Jaiprakash Pandey January 21, 2016 at 11:14 am - Reply

      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.

  10. Meg N. January 19, 2016 at 7:53 pm - Reply

    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.

    • Jaiprakash Pandey January 19, 2016 at 9:34 pm - Reply

      Welcome Meg N

  11. Anonymous January 19, 2016 at 3:31 pm - Reply

    Thanks, this post help me a lot!

    • Jaiprakash Pandey January 19, 2016 at 3:53 pm - Reply

      Welcome, I am glad it helped you

  12. Earl January 18, 2016 at 10:47 pm - Reply

    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.

    • Jaiprakash Pandey January 19, 2016 at 1:14 pm - Reply

      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.

  13. didier January 16, 2016 at 4:23 pm - Reply

    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)

    • Jaiprakash Pandey January 16, 2016 at 5:54 pm - Reply

      Certainly Didier one should be careful about it, in case you delete the layer containing objects on a block then that block will be redefined with missing objects.

  14. Lewis Skiles January 14, 2016 at 11:12 pm - Reply

    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.

    • Jaiprakash Pandey January 15, 2016 at 10:21 am - Reply

      Thanks Lewis, its certainly an efficient way of eliminating similar layers and making drawings clutter free.

  15. Anonymous January 14, 2016 at 9:28 pm - Reply

    Great article when purge has failed you:)

    • Jaiprakash Pandey January 14, 2016 at 9:44 pm - Reply

      Yes, I guess sometimes you have to look for alternatives when conventional method fails 🙂

  16. Anonymous January 14, 2016 at 1:29 pm - Reply

    So educative will try it….. Thanks

    • Jaiprakash Pandey January 14, 2016 at 1:49 pm - Reply

      welcome

Leave A Comment