Duplicate and overlapping geometry is one of the most common headaches in CAD drafting. Whether you have stacked blocks, duplicate survey points, or multiple line endpoints landing on the exact same coordinate, invisible overlaps can inflate material takeoffs, break CNC toolpaths, and bloat file sizes.
While AutoCAD’s built-in OVERKILL command deletes duplicates automatically, sometimes you need to audit and inspect where overlaps are happening—and how many objects are stacked there—before removing anything.
In this post, you’ll get a free, ready-to-use AutoLISP routine (COUNTOVERLAP) that scans your selection, counts overlapping coordinates, and places a clean, color-coded text label showing the exact overlap count at each spot.
Key Features of the COUNTOVERLAP Routine
- Multi-Object Support: Detects overlaps across Points, Blocks (INSERT), Circles, Arcs, Lines (start and end points), and Polylines (LWPOLYLINE) vertices.
- Cross-Type Counting: If a line endpoint, a block insertion point, and a polyline vertex all meet at the exact same coordinate, the label displays
3. - Clutter-Free Output: Locations with only
1object are ignored—labels (2,3,4, etc.) only appear where two or more items overlap. - Dedicated Layer & Color: Automatically creates a layer named
OVERLAP_COUNTSin Red (Color 1) so you can easily isolate, review, or delete all generated numbers in one click usingLAYDELorQSELECT. - Adjustable Tolerance: Built-in
0.01coordinate tolerance catches points that are nearly touching.
The AutoLISP Code
Copy the entire code block below and paste it into a plain text editor like Notepad:
How to Load and Use This LISP in AutoCAD
- Save the Script: Open Notepad, paste the code above, and click File > Save As. Name the file
CountOverlap.lspand change Save as type to All Files (*.*). - Load into AutoCAD: Open your drawing, type
APPLOAD(orAP) in the command line, and press Enter. Browse toCountOverlap.lsp, select it, and click Load. - Run the Command: Type
COUNTOVERLAPin the command line and press Enter. - Select Geometry: Window-select the area or entire drawing you want to check and press Enter.
- Set Text Height: Press Enter to accept your current default text height, or type a custom height value. Red count labels will immediately appear next to every overlapping point.
Easy Customization Tips
You can tweak the first three variables at the top of the code to match your company’s CAD standards:


No comments:
Post a Comment