Unable to delete a layer in AutoCAD
The following layers can't be deleted:
1. Layer 0 and Layer Defpoints that are default layers.
2. The current active layer. To delete the layer, you have to shift to another layer, or just set another layer as the current active layer.
3. Layers containing any object
- In the first case where there are entity objects on this layer, execute qselect command, select all the objects on the layer, and move them to another layer, or just delete them.
- In the second case where there is no entity object on this layer, or the above action has been taken, but the layer still can't be deleted, the graphics on the layer might probably incorporated into a block, so you have to open the block editor, and move the graphic elements to another layer. The problem is, if there are many blocks, how can we identify the right block and the graphic elements? Solution: hide or freeze all objects in the drawing, and insert all blocks into another layer, decompose (explode or break up) all of them, and use the mouse to frame them up, check the layer information to identify the elements on the layer to be deleted. Then redefine the block, or modify it in the block editor. So it's better to apply Layer 0 when creating a block.
- If there is a block on the layer or if objects (such as blocks) are referencing the layer, when you insert a graphic after a block is created, and then you explode or delete it for some reason, even you delete all the visible graphical elements from this layer, you still can't delete the layer, as there are other hidden elements (such as blocks) on the layer. There are two ways to delete the layers of this kind:
- Use the PURGE command (shortcut keys "pu") which can be used to clear out nearly all hidden elements, including dimension style, printing style, multiline style, blocks, layers, text style, linetype and graphics. First use the command to clear out the blocks and hidden elements that are no longer required, and then delete the layer. Now the layer can be directly deleted.
- As for the layers that still couldn't be deleted after the PURGE command is executed, you have to open the additional CAD menu "Express", and use the "laymrg" command to combine the layers. The "laymrg" command can integrate a layer into another layer, making it totally disappear. In this way, the layer is indirectly deleted! This command can be used to delete any layer, no matter whether there is any other graphical element.
4. Xref-dependent layers: use the laydel command to delete these layers