Adding up lengths in AutoCAD is one of those jobs that looks like it should take five seconds and then does not. TAPE selects any mix of curves, adds up their true lengths, and prints the total — following every arc and spline curvature properly rather than measuring point to point.
What TapeMeasure does
Type TAPE, select objects, and the total length appears at the command line. Lines, arcs, circles, ellipses, splines and polylines are all handled, including polylines with bulged segments — the distance measured along the arc, not the straight line between the two vertices either side of it.
The result is formatted with rtos, which means it honours the drawing’s own LUNITS and LUPREC settings. If the drawing is set to four decimal places in millimetres, that is what you get back — the same units as everything else on the sheet, with no mental conversion.
It reads the drawing and changes nothing. There is no undo group because there is nothing to undo.
How to use it
- Load the routine with
APPLOAD, or put it in a folder on your support file search path and load it from there. - Type
TAPEat the command line. - Select the objects to measure. Anything that is not a measurable curve cannot be picked — see below for why that matters.
- Press Enter. The total prints at the command line.
Command: TAPE
Select objects to measure: 1 found
Select objects to measure: 12 found, 13 total
Select objects to measure:
Total length of 13 objects: 48620.5
How it works
Every curve in AutoCAD is internally parameterised: it runs from a start parameter to an end parameter, and the distance along it at any parameter can be queried directly. Asking for the distance at the end parameter therefore returns the whole length of the curve — correctly following every arc and every spline curvature on the way. That is the entire measurement, one call per object:
(vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent))
The obvious alternative — and what a lot of older routines do — is to run the AREA command once per object and read the PERIMETER system variable back afterwards. That works, after a fashion, but it is slow across a large selection, it disturbs the active command state, and it returns nothing meaningful for an open spline. Querying the curve directly is exact for every supported type and touches no command state at all.
The measurement is wrapped in vl-catch-all-apply, because a degenerate object throws rather than politely returning zero. A zero-radius circle, a spline whose control points coincide, a polyline with a single vertex — these turn up in real drawings, usually inherited ones, and any of them would otherwise abort the count part way through. Catching each measurement individually means one bad object costs you that object, not the whole total.
Selection is filtered at the point of picking, with a filter of ARC,CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE. The wildcard catches POLYLINE, LWPOLYLINE and 3DPOLYLINE alike. Filtering at selection rather than testing afterwards is deliberate: an object with no length simply cannot be picked, which is far clearer than quietly scoring it zero and leaving you to wonder why the total looks low.
Anything that was selected but measured as zero is counted separately and reported. A clean run prints just the total; a run that hit a degenerate object always says so. A suspect number arrives with its own explanation attached rather than silently understating the answer.
Notes and limits
- Only the listed types can be selected. Text, blocks, hatches and regions have no length to report and are excluded at the filter, so they cannot be picked by accident.
- A circle or a closed polyline returns its full perimeter, not a partial arc. That is usually what you want when totalling; if it is not, break the object first.
- Blocks are not looked inside. Curves nested in a block reference are not counted — explode first, or measure the source geometry.
- The total is in drawing units. If the model is drawn at 1:1 in millimetres, so is the answer.
Download and details
| Name | TapeMeasure — total the length of every selected curve |
| Download | TapeMeasure.lsp — 5.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | TAPE |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 5.9 KB, 150 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| 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
- ZONE LISP — total polyline length or area by layer instead of by selection
- Drawing scale chart — when the model units and the plotted size differ
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program