SPANTAG labels each selected object with its own length, as a live field placed at the object’s midpoint. Select a run of lines and polylines and every one is labelled, sitting on its own midpoint, rotated to run along the object.
What SpanTag does
Because the labels are fields rather than typed text, stretching the geometry updates every figure automatically. On a setting-out drawing that is the difference between a schedule that stays true and one that quietly stops being true the first time somebody adjusts a line.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Set the current text style and height — the labels use them.
- Type
SPANTAG. - Select the objects to label.
How it works
The right property is used per object type. A circle reports Circumference, an arc reports ArcLength, and everything else reports Length. Asking a circle for its Length would return nothing at all — not an error, an empty label — which is why the property name is chosen from the entity type rather than assumed.
Text stays readable. Labels are rotated to align with the object they measure, but any angle that would leave text upside-down is flipped through 180°. So a line running down-left reads left-to-right rather than being mirrored.
Each label is created with a background mask, so it stays legible where it sits on top of the line it is measuring. The current text style and height are used.
The number display is controlled by SpanTag:Format; %lu6 means decimal linear units. Run FIELDSNOOP on a field you like the look of to discover its code.
Notes and limits
- The labels are fields, so they follow the geometry and update on regeneration.
- Deleting a labelled object breaks its field, which then shows
####. - Set the text style and height first. The labels take the current ones.
- Masked labels obey draw order like any other mask.
Download and details
| Name | SpanTag — label objects with their length, as a live field at the midpoint |
| Download | SpanTag.lsp — 11.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | SPANTAG |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 11.2 KB, 280 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| Compatibility | AutoCAD (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. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- LENGTHTOTAG LISP — a total pushed into a block attribute instead
- SEGREPORT LISP — every segment of one polyline as a schedule
- FIELDSNOOP LISP — find the formatting code you want
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program