Homeโ€บ Blogโ€บ LWP LISP: Delete All Entities on a Picked Layer Free Download
๐Ÿ“ LISP

LWP LISP: Delete All Entities on a Picked Layer Free Download

๐Ÿงฎ 1  |  ๐ŸŸข 1
24 Jun 2026 Trishunya Team
LWP LISP: Delete All Entities on a Picked Layer Free Download
๐Ÿ“ LISP · CAD UTILITIES

LWP LISP: Delete All Entities on a Picked Layer (Free AutoLISP Download)

๐Ÿ“… 24 Jun 2026 ๐Ÿท๏ธ CAD BGBgol Global
LWP AutoLISP routine, Delete All Entities on a Picked Layer, shown inside a CAD window

A layer cannot be deleted while it still contains entities, everything on it must be erased first. LWP automates that: pick one entity on the target layer, and every entity on that same layer throughout the current drawing is deleted in one step.

LYRWIPE-bgol (Delete All Entities on a Picked Layer)

CATEGORY
Utility Lisps
COMMAND NAME
LWP
LISP FILE
LYRWIPE-bgol.lsp
LICENSE
Open-source, free

Command Type: AutoLISP routine (works in AutoCAD, BricsCAD, ZWCAD and most AutoLISP-compatible CAD platforms)
Developed by: BGol Community, bgol.in

Inspired by the general concept of pick-based, layer-wide deletion utilities used in CAD drafting workflows. This is an original, independently written routine, new file name, new command name, new source code, created so the CAD community has a free, editable, open-source alternative.

Overview

A layer cannot be deleted while it still contains entities, everything on it must be erased first. LWP automates that: pick one entity on the target layer, and every entity on that same layer throughout the current drawing is deleted in one step.

How to Use

  1. Load LYRWIPE-bgol.lsp into your CAD session (drag-and-drop the file onto the drawing window, or use the APPLOAD command).
  2. Type LWP at the command line and press Enter.
  3. At the Select entity on layer to delete: prompt, click any single entity that resides on the layer you want cleared.
  4. The routine identifies that entity's layer and deletes every entity in the drawing on that same layer, then reports how many were removed.

Why Use It

  • Enables Layer Deletion, clears all entities from a layer in one step, a necessary prerequisite before the layer itself can be deleted.
  • Convenient for Scripted Regeneration, useful in workflows where a LISP program regenerates content on a specific layer; clearing the old content first avoids duplicate or stale entities.
  • Simple, Pick-Based Targeting, no need to know or type the exact layer name, just click any entity on the target layer.

Where to Use It

  • Clearing all entities from a layer before deleting the layer itself (native LAYER Delete requires an empty layer).
  • Regenerating drawing content on a specific layer (e.g., re-running a LISP that populates elevation text or grid lines) by first clearing prior output.
  • Quickly removing an entire category of annotation or geometry organized by layer, without manually selecting every individual entity.

Notes

  • Entities on a locked layer cannot be erased by AutoLISP; the routine will report how many entities were skipped for that reason, if any.
  • This routine only deletes entities, it does not delete the layer definition itself. Use the native LAYER / -LAYER Delete option afterward if you also want the now-empty layer removed.
  • Source code is fully open, feel free to study, modify, and redistribute it under the same open, free-for-all spirit.

Credits

Developed and shared for the CAD community by BGol Community. Website: https://bgol.in/ Free and open-source, use it, modify it, share it, for personal or commercial work alike.

Frequently Asked Questions

What CAD platforms does LWP work on?

LWP is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.

What should I know before using LWP?

Entities on a locked layer cannot be erased by AutoLISP; the routine will report how many entities were skipped for that reason, if any.

What is the main benefit of using LWP?

Enables Layer Deletion, clears all entities from a layer in one step, a necessary prerequisite before the layer itself can be deleted.

Is LWP free to use for commercial projects?

Yes. LWP is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.

How do I load the LWP command into my drawing?

Drag and drop LYRWIPE-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type LWP at the command line to run it.

๐Ÿค About BGol Community

BGol Community of Advanced Surveying builds and shares free, open-source tools for the survey and CAD drafting community.

๐Ÿ™Œ Made with โค๏ธ by BGol Community of Advanced Surveying

Free, open-source, and built for the CAD community, for personal or commercial use, always.

Back to all articles