[Search tip detail and code files using keywords, tip number, author name, etc ]
Get Rid of Stubborn Layers
Tip# 3059 By R.T. Rinehart On 14-Dec-2008
Rated By 2 users
Categories : Layer Tools, Layer Manager
Software type : AutoCAD
Rename File To : No Files to download.
This tip helps clean your files of hard-to-delete layers.

R.T. Rinehart sent us this tip that helps clean up your files.  Do you ever get those layers that just won’t delete no matter what you try? Even though there is nothing visible on them, you try to delete them and they just won’t go away. My office uses the National Cad Standard Template, and many times we are left with many unwanted layers in the drawing. Use the powerful Layer Delete command built into AutoCAD for these pesky rascals. Just enter LAYDEL at the command line and you will be given the option of selecting an object on the layer or you can enter “N” to get a dialog of layer names. Use your shift key in the dialog to select multiple layers for deletion (the current layer cannot be deleted by this command so be sure your current layer is something you want to keep). Be careful since everything on the layers you select will be deleted along with the layer itself. AutoCAD will prompt you for confirmation before proceeding with the deletion.

There are many uses for this command. I work on sites that often have different design scenarios or schematics during the course of the project. I keep each scenario on a different layer and when we reach a final decision just use the LAYDEL command to get rid of all the layers and entities for the unused scenarios. I hope you find many other uses as well.

Notes from Cadalyst Tip Patrol:  Maintenance of files is a must.  There are many times when extra items clutter up a file.  Sometimes weird things happen as in R.T.’s example above, empty layers won’t go away.  They can’t be deleted or purged.  The LAYDEL (layer delete) command will get rid of most layers and any objects on that layer.  It won’t delete a locked layer!  It is often a good idea to protect your layers, or the objects on that layer.  Great tip.


Average Rating:

User comments
Comment by Turner,Dean
Posted on 2008-12-15 16:10:33
Caveat: Civil 3d has an issue with the LAYDEL command in that even though there are no "Objects" that are on the layers, there are Styles that make use of the layers and as long as the styles exist in the drawing you will be unable to delete the layer.