Need to calculate the total length of multiple lines or polylines in AutoCAD?
A total-length routine adds the lengths of supported selected objects in drawing units. For a program with a named publisher and published terms, use Lee Mac’s TLEN page linked below. This is a different program from the older TOTL routine previously linked here. BuildMEP provides the installation video, measurement checks and historical TOTL notes; it does not claim authorship of either routine.
| Quick Specs | |
|---|---|
| 💰 Price | Free |
| Compatibility | Depends on the routine’s functions, edition, release and operating system; see checks below. |
| 🎯 Difficulty | Beginner |
This Guide Includes
A link to the publisher’s total-length program, a loading guide, the BuildMEP installation video, and a known-length reference for checking results. The older TOTL workflow is retained separately for readers who already use that file.
📦 Total Length AutoCAD LISP FREE
Open TLEN on the Publisher’s Site ▶ Watch Installation Video
🧰 More free BuildMEP tools
- MEPCOUNT Block Count LISP – count every block by name or layer, export to Excel
- Total Area LISP guide – total area of rooms, zones and hatches
- Free Heat Load Calculator – room-by-room cooling load, with Excel version
- HVAC Unit Converter – airflow, pressure, capacity and more
- BuildMEP LISP files on GitHub – source code for our own routines
Using the Publisher’s TLEN Routine
Open Lee Mac’s Total Length page and read its terms. Obtain the source there and follow the publisher’s saving and loading instructions. BuildMEP links to the publisher rather than hosting a copy.
- Save the publisher’s source as a plain-text
.lspfile, keeping its header. - In a supported AutoCAD session, run
APPLOAD, select the reviewed file and load it for the current session. - Enter
TLEN, select the supported objects and finish the selection. Read the combined length at the command line. - Compare a known selection with Properties or LIST. Check drawing units and the
LUNITS/LUPRECdisplay settings before a take-off.
The publisher lists this routine for Windows AutoCAD/compatible LT, not Mac. Check the exact installed release. BuildMEP has not runtime-tested TLEN. Our video demonstrates loading methods; it does not change the command defined by your chosen file.
Historical TOTL Reference
The following sections document the older TOTL file for existing users. Its original author and redistribution terms remain unestablished, so the main source button above now points to the separate publisher’s TLEN page. Do not run TOTL expecting it to invoke TLEN, or apply the older alert-dialog instructions to the publisher’s command-line output. The existing archive has not been replaced or relabelled.
Original Reference Example — Not Yet Tested in AutoCAD
Use two lines and one circle in a separate test drawing. The values below are calculated expectations, not measured TOTL output.
| Object | Geometry | Calculated length (drawing units) |
|---|---|---|
| Line A | (0,0,0) to (1000,0,0) | 1,000 |
| Line B | (0,0,0) to (0,2000,0) | 2,000 |
| Circle C | Centre (3000,0,0), radius 500 | 1,000 × π ≈ 3,141.59265 |
The mathematical reference total is 3,000 + 1,000 × π ≈ 6,141.59265 drawing units. If one drawing unit represents one millimetre, this corresponds to approximately 6.14159 metres. Selecting only the two lines gives 3,000 units. Check drawing units and displayed precision in AutoCAD.
This example has not yet been tested in AutoCAD. Compare the individual objects with Properties or LIST, then run TOTL on the same selection and record your AutoCAD edition, release, units and displayed result before relying on the routine for a take-off.
📺 Video Tutorial
Watch the complete step-by-step installation guide below.
What Is an AutoCAD LISP?
AutoLISP is a scripting language developed specifically for AutoCAD. It allows users to automate repetitive tasks, create custom commands, and improve drafting efficiency.
Instead of performing multiple manual operations, a LISP routine executes them automatically with a simple command.
Thousands of engineers worldwide use LISP routines daily to improve their workflows.
What Does the TOTL Command Measure?
The inspected TOTL routine sums selected lines, arcs, circles, ellipses, lightweight/ordinary polylines and splines. Its filter excludes polygon meshes and polyface meshes. Block inserts and their nested contents are not traversed. A circle contributes its circumference, and duplicate or overlapping objects are counted separately.
Examples to test separately on a copy of a drawing include:
- Lines
- Polylines
- Arcs
- Splines
- Multiple selected entities
Instead of measuring each object individually, the LISP adds every selected length and displays the total instantly.
Benefits of Using the Total Length LISP
Save Time
Measure hundreds of line segments in seconds.
Check the Combined Result
A combined length reduces repetitive manual addition, but it still needs checking. Duplicate or overlapping objects count separately, nested block contents are not traversed, and drawing scale or unit errors carry into the result.
Increase Productivity
Spend more time designing and less time measuring.
Perfect for Quantity Take-Offs
Ideal during BOQ preparation and estimating.
Easy Installation
No programming knowledge required.
Common Engineering Applications
This LISP is useful for:
HVAC Engineering
- Duct length calculation
- Refrigerant piping
- Condensate drain routing
Plumbing
- Water supply piping
- Drainage layouts
- Pump connections
Fire Protection
- Sprinkler piping
- Fire hose routing
Electrical
- Cable tray length
- Conduit routing
- Underground duct banks
Civil Engineering
- Road centerlines
- Survey boundaries
- Utility layouts
Architecture
- Wall centerlines
- Floor plans
- Site layouts
Edition, Platform and Measurement Checks
AutoCAD LT for Windows introduced AutoLISP in 2024. This file calls vl-load-com, vlax-ename->vla-object, vlax-curve-getEndParam and vlax-curve-getDistAtParam. Autodesk’s curve-function table and ActiveX conversion table list these operations for Windows AutoCAD and AutoCAD LT 2024. The ActiveX calls are unavailable on Mac and Web, so the historical TOTL file is not suitable there as supplied. Function support is documented; execution in each release is not tested here.
The 640-byte ZIP contains one file, Total length (TOTL).lsp, with 1,059 uncompressed bytes. It defines C:TOTL but declares no author, licence or routine version. Its older-version alert mentions “VxJoinLines”; that text is not evidence of authorship or a verified compatibility range. BuildMEP provides this use guide without claiming authorship of the source. The archive was inspected as text, not executed.
The sum is in drawing length units. A drawing in millimetres needs division by 1000 for metres. Check model versus paper space, 2D versus 3D length, duplicate/overlapping segments and block contents. Duct or pipe centreline length does not automatically include fittings, waste, vertical drops or procurement allowances.
Historical TOTL Installation Notes
Method 1 – Drag & Drop
- Use the existing TOTL file only after establishing its source and applicable terms. For the publisher-linked TLEN routine, use the separate workflow above.
- Open AutoCAD.
- Drag the LISP into AutoCAD.
- Review the source and author terms first. Load a trusted file for the current session using your edition’s supported loading workflow; do not enable automatic loading before verification.
Installation completed.
Method 2 – APPLOAD
- Open AutoCAD.
- Type APPLOAD.
- Press Enter.
- If you already have the older archive, extract it and select its reviewed .lsp file.
- Click Load.
- Close the window.
Historical TOTL Command and Output
- For the older inspected file, enter TOTL. This does not invoke the publisher’s TLEN routine.
- Press Enter.
- Select all required objects.
- Press Enter again.
The routine shows the combined length in an alert dialog. It can use a supported preselection or prompt for objects. Compare a known length with AutoCAD’s Properties or LIST output before using the total for a take-off.
How to Find the LISP Command
Open the LISP file with a text editor.
The older TOTL file begins with the command definition below. The publisher-linked alternative defines c:tlen instead.
(defun C:TOTL ( / CurObj CurSet FltLst TmpLgt TotLgt)
The text after C: is the AutoCAD command.
Only modify the routine if the author’s terms permit it. Preserve attribution and keep an original copy.
After editing:
- Save the file
- Reload using APPLOAD
The new command becomes available.
Why Engineers Love This Tool
Unlike manual measurement methods, the Total Length LISP requires only one command and one selection.
Benefits include:
- Faster project completion
- Cleaner workflow
- Less repetitive work
- Reduced drafting errors
- Better productivity
Frequently Asked Questions
Is this LISP free?
Lee Mac publishes the linked TLEN source with his terms of use. Read those terms before use, copying or modification. BuildMEP links to his page and does not distribute a copy. The older TOTL file is a separate routine whose original terms remain unestablished.
Does it work with AutoCAD LT?
The publisher lists TLEN as compatible with AutoCAD LT and not Mac. Confirm the exact Windows release and test a known length in your installation. The older TOTL function/documentation review below is separate and is not a runtime test of TLEN.
Can I edit the command?
The name after c: identifies the command: TLEN in the linked program and TOTL in the older file. Follow the terms for the particular source; do not transfer a licence or attribution between them.
Can I use it every day?
First review the chosen source and its terms, then validate representative drawings in your installed edition. Consider supported autoload only after checking results, and repeat checks after updates.
Monthly Engineering Briefing
Get notified when new BuildMEP guides and tools publish. One concise email a month.
Related BuildMEP Resources
You may also like:
- AutoCAD Total Area LISP – measure closed-boundary areas the same way
- MEP Engineering Downloads
- HVAC Duct Sizing Guide
- Ductulator Tool
Using the Routine in Daily Drafting
The Total Length AutoCAD LISP is one of the most practical productivity tools for AutoCAD users. It automates repetitive length calculations, saves time on engineering projects, and improves overall drafting efficiency.
Whether you’re working on HVAC, plumbing, fire protection, electrical, or architectural drawings, this simple LISP routine can become an essential part of your AutoCAD toolkit.
If you found this guide helpful, subscribe to the BuildMEP YouTube channel and explore more engineering tutorials, calculators, and CAD resources available on BuildMEP.


