Homeโ€บ Blogโ€บ KIN LISP: Erase Entities Outside a Polyline Boundary Free Download
๐Ÿ“ LISP

KIN LISP: Erase Entities Outside a Polyline Boundary Free Download

๐Ÿงฎ 2  |  ๐ŸŸข 2
29 Jun 2026 Trishunya Team
KIN LISP: Erase Entities Outside a Polyline Boundary Free Download
๐Ÿ“ LISP · CAD UTILITIES

KIN LISP: Erase Entities Outside a Polyline Boundary (Free AutoLISP Download)

๐Ÿ“… 29 Jun 2026 ๐Ÿท๏ธ CAD BGBgol Global
KIN AutoLISP routine, Erase Entities Outside a Polyline Boundary, shown inside a CAD window

KIN ("Keep Inside") is the inverse of a "clear inside a boundary" tool: it erases every entity located *outside* a selected closed polyline, keeping only what falls within it. Useful for isolating a specific area of interest from a larger, densely-populated drawing.

KEEPIN-bgol (Erase Entities Outside a Polyline Boundary)

CATEGORY
Utility Lisps
COMMAND NAME
KIN
LISP FILE
KEEPIN-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 boundary-based selective erase utilities used in CAD drafting. 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

KIN ("Keep Inside") is the inverse of a "clear inside a boundary" tool: it erases every entity located *outside* a selected closed polyline, keeping only what falls within it. Useful for isolating a specific area of interest from a larger, densely-populated drawing.

How to Use

  1. Load KEEPIN-bgol.lsp into your CAD session (drag-and-drop the file onto the drawing window, or use the APPLOAD command).
  2. Type KIN at the command line and press Enter.
  3. At the Select boundary polygon: prompt, click the closed polyline that defines the area you want to keep.
  4. The routine tests every other entity in the drawing against that boundary and erases anything whose reference point falls outside it. The boundary polyline itself is left untouched.

Why Use It

  • Efficient Isolation, quickly extracts/isolates a specific area of interest from a larger drawing without manually deleting everything outside it one entity at a time.
  • Accuracy, uses the exact defined polygon boundary (even if irregular) to precisely determine which entities survive, avoiding accidental removal of entities meant to be kept.
  • Streamlined Workflow, simplifies preparing a focused sub-drawing or extract from a larger, cluttered source drawing.

Where to Use It

  • Isolating a specific parcel, grid section, or area of interest from a larger survey drawing by keeping only content within a chosen boundary.
  • Preparing a focused extract or "crop" of a drawing for a specific deliverable, without manually deleting everything outside the area of interest.
  • Any drawing cleanup task requiring content outside a (possibly irregular) boundary to be removed while preserving everything inside it.

Notes

  • Entity "location" is approximated using its insertion point (for TEXT/INSERT/CIRCLE/POINT) or start/first vertex (for LINE and polylines). Very large or oddly-shaped entities are tested by that single reference point, not their full extents.
  • Uses a standard ray-casting point-in-polygon algorithm against the boundary's vertex list, so it correctly handles irregular (non- rectangular) boundaries.
  • See also the companion tool CLRIN-bgol (CIN) which performs the opposite operation, erasing entities *inside* a boundary instead.
  • 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 KIN work on?

KIN 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 KIN?

Entity "location" is approximated using its insertion point (for TEXT/INSERT/CIRCLE/POINT) or start/first vertex (for LINE and polylines). Very large or oddly-shaped entities are tested by that single reference point, not their full extents.

What is the main benefit of using KIN?

Efficient Isolation, quickly extracts/isolates a specific area of interest from a larger drawing without manually deleting everything outside it one entity at a time.

Is KIN free to use for commercial projects?

Yes. KIN 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 KIN command into my drawing?

Drag and drop KEEPIN-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type KIN 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