AutoCAD Erase Layer LISP: Delete All Objects on a Layer
Erases every object on the layer of a picked object, after showing the count and asking for confirmation.
LAYERASELoad the downloaded .lsp file with the APPLOAD command in AutoCAD or GstarCAD, then type the command name. How to load a LISP file
Download all tools in one file (138 KB)LAYERASE is a small AutoCAD erase layer LISP tool. You click one object, the tool reads its layer, counts every object on that layer in model space and in every paper space layout, and asks whether those objects should be erased. The default answer is No, so pressing Enter by mistake does nothing.
The tool erases objects only; the layer definition stays in the layer list with all its settings, and you can PURGE it later if you want. That is the main difference from AutoCAD's built-in LAYDEL, which removes the layer and everything on it, including objects inside block definitions. LAYERASE is the more cautious choice when you want to empty a layer, such as an old markup or revision layer, without touching your layer structure.
The whole erase is recorded as a single undo step, so one U brings everything back. It works the same way in full AutoCAD and in GstarCAD.
How to use it
- Load layerase.lsp with APPLOAD.
- Type LAYERASE at the command line.
- Click any object on the layer you want to clear.
- Check the layer name and object count shown in the prompt.
- Type Yes to erase, or press Enter (No) to cancel.
Notes and tips
- The erase covers every layout, including paper space objects you are not looking at. Check the count before you confirm.
- Objects on a locked layer are not erased. Unlock the layer first; otherwise the reported count can differ from what was actually removed.
- Objects inside block definitions are not touched. If you click a block, the layer of the block reference is used.
- If you erased too much, U undoes the whole operation in one step.
Frequently asked questions
How do I delete all objects on a layer in AutoCAD?
Run LAYERASE, click any object on that layer and answer Yes. Every object on the layer is erased in all layouts, while the layer itself stays in the drawing.
What is the difference between LAYERASE and LAYDEL?
LAYDEL removes the layer and everything on it, including objects inside blocks. LAYERASE erases only the objects on the layer, keeps the layer definition and block contents, and shows the count and asks before erasing.
Can I undo it?
Yes. The erase is wrapped in a single undo group, so typing U right after restores all the objects.