Erase Objects Inside Polygon (CIN)
eplisp, the free multilingual LISP library
| Openly licensed; the original file is hosted here together with its license. | |
… Rate this tool: | |
| Commands | CIN |
|---|---|
| Category | Cleanup and Files |
| Author | BGol Community |
| Source | thevijayparmar/bgol-cad-lisps |
| License | MIT |
| Requirements | AutoCAD (full version, not LT). Uses ActiveX (vla/vlax); the repository says it also targets BricsCAD and ZWCAD. |
| Prompt language | English |
| Files | CLRIN-bgol.lsp (4 KB) |
| Added | 2026-10-26 |
| Download the original fileSource repository | |
Erases every object whose reference point (start, insertion or center point) lies inside a picked polyline boundary, without asking for confirmation.
CIN is a BGol Community routine for clearing an area. When the inside of a region has to be emptied, you pick the boundary polyline and everything inside is erased, instead of filtering objects with window selections.
Overview
The vertices of the picked boundary are read. Then every object in the drawing is scanned, and its first DXF 10 point (the start of a line, the insertion point of a block, the center of a circle, the first vertex of a polyline, and so on) is tested against the boundary with a ray-casting point-in-polygon check. Objects inside are erased, the boundary itself is kept, and the numbers of erased and kept objects are printed.
How to use it
- Save the drawing or work on a copy.
- Load CLRIN-bgol.lsp with APPLOAD.
- Type CIN at the command line.
- Pick the closed polyline to use as the boundary; the objects inside are erased immediately.
Notes and limitations
- Erases objects without asking; use U to undo if the result is wrong.
- The selection covers the whole drawing (ssget "_X"): paper-space (layout) objects whose coordinates fall inside the boundary are erased too.
- The decision is based on a single reference point: an object crossing the boundary is erased entirely if its start point is inside. Types whose DXF 10 point is not on the object, such as hatches, can give unexpected results.
- Arcs in the boundary are treated as straight chords, and an open polyline is treated as if it were closed. A legacy 3D polyline is not read correctly as a boundary.
- Objects on locked layers cannot be erased but may still be counted as erased.
- The repository is new (2026); test the routine on a copy of the drawing first.
Source and license
This tool is not made by eplisp. The file is published unchanged under its author's license; copyright stays with the author.
- CLRIN-bgol.lsp (4 KB)
- License text
References
- Source repository: thevijayparmar/bgol-cad-lisps – https://github.com/thevijayparmar/bgol-cad-lisps/tree/3acbe32f71b489f4c81dcd9372f989591a9be858/Utility%20Lisps/Erase%20Entities%20within%20Polyline
- Author: BGol Community – https://bgol.in/
- License: MIT – https://github.com/thevijayparmar/bgol-cad-lisps/blob/3acbe32f71b489f4c81dcd9372f989591a9be858/LICENSE
Found a mistake, or are you the author of this tool? Request a correction or removal