CHM LISP: Mark Alignment Chainages (Free AutoLISP Download)
CHM walks along a selected alignment polyline at a fixed chainage increment, drawing a perpendicular cross-section line at each point and labeling it with a formatted chainage value (e.g., Ch. 30.00 M). Cross-section geometry and chainage labels are kept on separate layers.
CHNMRK-bgol (Mark Alignment Chainages)
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 dialog-driven chainage marking utilities used in road/rail/channel alignment 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. This version uses simple command-line prompts instead of a compiled dialog box, so it works immediately with no extra dialog file to distribute.
Overview
CHM walks along a selected alignment polyline at a fixed chainage increment, drawing a perpendicular cross-section line at each point and labeling it with a formatted chainage value (e.g., Ch. 30.00 M). Cross-section geometry and chainage labels are kept on separate layers.
How to Use
- Load
CHNMRK-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
CHMat the command line and press Enter. - Select the alignment polyline.
- Answer the prompts:
- Starting chainage (default
0) - Chainage increment (default
30) - Cross-section line length (default
20) - Prefix text (default
Ch.) - Suffix text (default
M) - Precision / decimal places (default
2)
- The routine marks every chainage point along the alignment: a perpendicular cross-section line on layer
BGOL-CHM-CS(blue), and a formatted chainage label on layerBGOL-CHM-LBL(yellow). - A summary of how many chainage points were marked is echoed to the command line.
Why Use It
- Automates a tedious task, placing dozens or hundreds of correctly spaced, correctly labeled cross-sections in one command instead of manually drafting each one.
- Configurable labeling, prefix/suffix/precision match regional or project-specific chainage conventions.
- Clean layer separation, cross-section geometry and chainage labels sit on distinct layers, so each can be shown/hidden or plotted independently.
Where to Use It
- Preparing longitudinal sections and cross-section drawings for roads, railways, and irrigation/drainage channel design.
- Any infrastructure project requiring regularly spaced, labeled cross-sections along a defined alignment.
- Standardizing chainage marking conventions across a design team or project.
Notes
- Cross-section direction is computed as the perpendicular to the alignment's tangent at each chainage point, so lines stay correctly oriented even around curves.
- The routine stops automatically once it reaches the end of the alignment's length.
- 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
CHM is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Cross-section direction is computed as the perpendicular to the alignment's tangent at each chainage point, so lines stay correctly oriented even around curves.
Automates a tedious task, placing dozens or hundreds of correctly spaced, correctly labeled cross-sections in one command instead of manually drafting each one.
Yes. CHM 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 CHNMRK-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type CHM 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.