LSRT LISP: Sort Short Polylines onto a Review Layer (Free AutoLISP Download)
Infrastructure drawings sometimes end up with tiny, insignificant broken line fragments, from imprecise digitizing, breakline errors, or cleanup artifacts, that are too small to matter but hard to spot individually amid a large drawing. LSRT filters a selection of polylines by length, automatically moving every polyline shorter than a specified threshold onto a dedicated review layer.
LENSORT-bgol (Sort Short Polylines onto a Review Layer)
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 length-based polyline filtering utilities used in civil/infrastructure 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
Infrastructure drawings sometimes end up with tiny, insignificant broken line fragments, from imprecise digitizing, breakline errors, or cleanup artifacts, that are too small to matter but hard to spot individually amid a large drawing. LSRT filters a selection of polylines by length, automatically moving every polyline shorter than a specified threshold onto a dedicated review layer.
How to Use
- Load
LENSORT-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
LSRTat the command line and press Enter. - Specify the length threshold, polylines shorter than this value will be flagged.
- Select all the polylines to check against that threshold.
- Every polyline shorter than the threshold has its layer changed to
BGOL-LSRT-SHORT(colour red). Polylines at or above the threshold are left completely untouched. - Once isolated on the review layer, use standard layer tools to review, freeze, or delete all the flagged short polylines in bulk.
Why Use It
- Makes tiny, hard-to-see broken line fragments easy to find and manage in bulk by isolating them onto their own layer, rather than requiring you to visually hunt for and individually select each small fragment.
- Non-destructive by default, moving to a layer (rather than immediately deleting) lets you review the flagged polylines before deciding to delete, freeze, or otherwise handle them.
- Speeds up drawing cleanup significantly on complex infrastructure drawings where small artifact polylines are common and tedious to locate manually.
Where to Use It
- Cleaning up drawings that contain small, insignificant broken line fragments left over from digitizing, breakline processing, or CAD editing operations.
- Any quality-control pass on infrastructure engineering drawings where identifying and managing very short polyline segments is needed before finalizing or exporting the drawing.
- Preparing drawings for GIS export where tiny, meaningless line fragments could cause topology or data-quality issues if left in place.
Notes
- Only the entity's layer is changed, geometry, length, and all other properties remain exactly as they were, so the operation is fully reversible by moving entities back to their original layer.
- Run
LSRTagain with a different threshold at any time; polylines already onBGOL-LSRT-SHORTare re-evaluated like any other selected entity. - 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
LSRT is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Only the entity's layer is changed, geometry, length, and all other properties remain exactly as they were, so the operation is fully reversible by moving entities back to their original layer.
Makes tiny, hard-to-see broken line fragments easy to find and manage in bulk by isolating them onto their own layer, rather than requiring you to visually hunt for and individually select each small fragment.
Yes. LSRT is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.
Drag and drop LENSORT-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type LSRT 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.