PLEN LISP: Calculate Length by Layer (Free AutoLISP Download)
PLEN selects a batch of lines/polylines, sums their length grouped by layer, and writes a simple text summary table into the drawing, replacing a slow, manual, layer-by-layer length tally.
PLLENTAB-bgol (Calculate Length by 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 per-layer length summary 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
PLEN selects a batch of lines/polylines, sums their length grouped by layer, and writes a simple text summary table into the drawing, replacing a slow, manual, layer-by-layer length tally.
How to Use
- Load
PLLENTAB-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
PLENat the command line and press Enter. - Select the LINE and/or LWPOLYLINE entities you want totaled.
- Press Enter to finish the selection.
- Pick a point in the drawing for the results table.
- A text summary listing each layer name with its cumulative length, plus a grand total, is placed on layer
BGOL-PLEN.
Why Use It
- Time savings, automates a manual, layer-by-layer length tally.
- Accuracy, removes human error from manual length summation.
- Quantity takeoffs, per-layer totals are directly usable for material estimates, bill-of-quantities, or reporting.
Where to Use It
- Producing quantity summaries for infrastructure networks (water pipe, drainage line, road length per category).
- Bill-of-quantities preparation where linear measurements need to be totaled and reported by feature type.
- Any CAD workflow needing a quick layer-grouped length summary instead of checking each entity individually.
Notes
- Works on LINE and LWPOLYLINE entities; other entity types are ignored by the selection filter.
- Lengths are summed using each entity's true curve length (via
vlax-curve-getDistAtParam), so arc segments within a polyline are measured correctly, not approximated as straight chords. - The summary is written as plain TEXT rows for maximum compatibility; edit
BGOL:PLEN-MakeTextif you prefer a native TABLE entity 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
PLEN is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Works on LINE and LWPOLYLINE entities; other entity types are ignored by the selection filter.
Time savings, automates a manual, layer-by-layer length tally.
Yes. PLEN 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 PLLENTAB-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type PLEN 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.