• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

CHAINAGE LISP: Label Running Distance Along a Polyline

August 6, 2026

CHAINAGE labels how far along you are at every vertex of a polyline — the running distance from the start, written beside each point. Roads, drains, kerb lines, fences, cable routes, section lines: anything measured from one end.

What Chainage does

Three ways of writing it. Distance is a plain running length — 0, 12.5, 31.75. Station is the surveyor’s form, metric in thousands — 0+000, 1+250.000. Imperial is the same idea in hundreds of feet — 0+00, 12+50.00.

A starting chainage can be given, so a length picked up part way along a route is labelled with its true position rather than starting at zero.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type CHAINAGE.
  3. Pick the line, polyline, arc, spline or ellipse.
  4. Choose the label format and give a starting chainage if the run does not begin at zero.

How it works

Arc segments are measured properly. Adding up straight-line distances between vertices measures the chord rather than the arc, so on a polyline with any curve in it every label after the first bend is short — and increasingly so along the run.

Distances come from the curve itself through vlax-curve-getDistAtParam, which asks AutoCAD how far along the object a point actually is. It follows bulges exactly, and it behaves the same way on a line, an arc, a spline or an ellipse — so all of those can be labelled too, not just polylines.

Closed polylines keep their last segment. A run that stops at the final vertex without coming back to the start drops the closing length, which on a boundary is the one figure somebody will check.

Notes and limits

  • Lightweight polylines work — which is worth saying, because everything AutoCAD has drawn by default since Release 14 is one.
  • Arcs are measured along the curve, not chord to chord.
  • Station format is in thousands, imperial in hundreds of feet.
  • One undo group covers the whole run of labels.

Download and details

NameChainage — label running distance at every vertex of a line
DownloadChainage.lsp — 11.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandCHAINAGE
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size11.3 KB, 261 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • RUNLENGTH LISP — distance between two points along a chain
  • SPANTAG LISP — label each object with its own length
  • TRACKTEXT LISP — slide labels along the curve afterwards
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in