PBRK LISP: Break All Intersecting Polylines (Free AutoLISP Download)
PBRK finds every point where two or more selected polylines cross one another and breaks each polyline into separate straight segments at those points, all in a single command, instead of running BREAK by hand at every crossing.
PBRKALL-bgol (Break All Intersecting Polylines)
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 batch break-at-intersection utilities used in CAD/survey 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
PBRK finds every point where two or more selected polylines cross one another and breaks each polyline into separate straight segments at those points, all in a single command, instead of running BREAK by hand at every crossing.
How to Use
- Load
PBRKALL-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
PBRKat the command line and press Enter. - Select two or more LWPOLYLINEs that cross each other.
- Press Enter to finish the selection.
- Every selected polyline is rebuilt as a set of individual segments broken at each mutual intersection point, placed on a dedicated layer,
BGOL-PBRK(colour green). The original polylines are removed.
Why Use It
- Batch operation, breaks many crossing polylines at once instead of repeating
BREAKmanually at every intersection. - Topology-ready output, produces individually editable segments at every junction, a common prerequisite for GIS import or network analysis.
- Time savings, turns a slow, error-prone manual editing task into one command run.
Where to Use It
- Preparing road, drainage or utility networks for GIS import where segments (not continuous polylines) are needed at each junction.
- Any drafting task requiring polylines to be split wherever they cross other selected polylines.
- Cleanup step before running routines that expect pre-segmented, non-overlapping geometry.
Notes
- Only LWPOLYLINE entities are considered; select all polylines you want checked against each other in a single selection.
- Intersections are found using each pair's ActiveX
IntersectWithmethod, so line, arc and curve segments within the polylines are all handled correctly. - Original polylines are deleted after breaking; keep a backup copy of the drawing if you want to preserve the un-broken originals.
- 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
PBRK is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Only LWPOLYLINE entities are considered; select all polylines you want checked against each other in a single selection.
Batch operation, breaks many crossing polylines at once instead of repeating BREAK manually at every intersection.
Yes. PBRK 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 PBRKALL-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type PBRK 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.