Short description
📏 TLength is an AutoCAD AutoLISP utility that calculates the total length of selected drawing objects and copies the numeric result directly to the clipboard.
Command:
TLENGTH
Description:
📐 TLength helps AutoCAD and Civil 3D users measure combined object lengths quickly from the command line.
🚀 Run the TLENGTH command, select supported geometry, and the tool sums the total length or perimeter using AutoCAD ActiveX curve data. The result is printed in the command line and copied to the Windows clipboard as a clean numeric value with four decimal places.
🧰 Supported object types include LINE, POLYLINE, LWPOLYLINE, ARC, CIRCLE, ELLIPSE, SPLINE, MLINE, REGION, and MPOLYGON. This makes it useful for quantity takeoff, drafting checks, linear measurement control, Civil 3D production drawings, CAD auditing, and fast length reporting.
📋 The clipboard workflow makes it easy to paste the calculated value into Excel, reports, labels, schedules, quantity tables, BoQ calculations, or other downstream documentation.
Helper function: (if any)
🧩 c:TLENGTH is the main AutoCAD command function.
📋 copy-to-clipboard creates an htmlfile COM object and writes the measured numeric result to the Windows clipboard.
🔄 vl-load-com support is guarded with a validator-safe COM availability check.
Functionalities:
📏 Calculates total selected length from multiple AutoCAD object types.
📐 Uses vla-get-length for LINE, 3D POLYLINE, and POLYLINE objects.
🧭 Uses vla-get-arclength for ARC objects.
⭕ Uses vla-get-circumference for CIRCLE objects.
🌀 Uses vlax-curve-getdistatparam for SPLINE and ELLIPSE objects.
🧱 Calculates MLINE length from coordinate segment distances.
🟦 Uses vla-get-perimeter for REGION and MPOLYGON objects.
🔢 Formats the final result with four decimal places using rtos.
📋 Copies the final numeric value directly to the clipboard.
🖥️ Prints a single-object or multi-object total length message in the AutoCAD command line.
🧹 Cleans up the temporary AutoCAD selection set after calculation.
Result:
✅ The result is a fast combined length value for selected AutoCAD geometry, displayed in the command line and copied to the clipboard for immediate reuse.
Images, animations etc.
XAML code:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="TLength"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: TLENGTH</Bold> <LineBreak/> <Bold>Version: 1.0 Date: 20.06.2026 6:38:49PM</Bold> <LineBreak/> <Hyperlink>AI+https://gist.github.com/kevinluo201/51450de14f63382c046c6d840bb42c96</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">📏 Function Syntax: TLENGTH</Run></Bold><LineBreak/> <Bold><Run Foreground="Orange">Command: TLENGTH</Run></Bold><LineBreak/> <LineBreak/> <Run Foreground="White">🚀 TLength is an AutoCAD AutoLISP length calculator for quickly measuring the combined length or perimeter of selected drawing objects.</Run><LineBreak/> <Run Foreground="LimeGreen">The tool prints the total value in the AutoCAD command line and copies the clean numeric result directly to the Windows clipboard.</Run><LineBreak/> <LineBreak/> <Bold><Run Foreground="DodgerBlue">📘 SEO Optimized Description</Run></Bold><LineBreak/> <Run Foreground="White">📐 Use </Run><Bold><Run Foreground="Orange">TLENGTH</Run></Bold><Run Foreground="White"> to calculate total AutoCAD object length from multiple selected entities in one fast command.</Run><LineBreak/> <Run Foreground="White">🧰 The command supports </Run><Bold><Run Foreground="LimeGreen">LINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">POLYLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">LWPOLYLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">ARC</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">CIRCLE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">ELLIPSE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">SPLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">MLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="LimeGreen">REGION</Run></Bold><Run Foreground="White">, and </Run><Bold><Run Foreground="LimeGreen">MPOLYGON</Run></Bold><Run Foreground="White"> objects.</Run><LineBreak/> <Run Foreground="White">📋 The calculated value is automatically copied to the clipboard, making it practical for Excel quantity takeoff, BoQ tables, reports, labels, schedules, and CAD production checks.</Run><LineBreak/> <LineBreak/> <Bold><Run Foreground="LimeGreen">⚙️ Functionalities</Run></Bold><LineBreak/> <Run Foreground="White">📏 </Run><Bold><Run Foreground="LimeGreen">Total length calculation</Run></Bold><Run Foreground="White"> - sums selected linear and curved AutoCAD entities into one combined value.</Run><LineBreak/> <Run Foreground="White">📐 </Run><Bold><Run Foreground="LimeGreen">Polyline and line support</Run></Bold><Run Foreground="White"> - reads lengths from standard line, polyline, lightweight polyline, and 3D polyline objects.</Run><LineBreak/> <Run Foreground="White">🌀 </Run><Bold><Run Foreground="LimeGreen">Curve support</Run></Bold><Run Foreground="White"> - measures arcs, circles, ellipses, and splines using AutoCAD curve data.</Run><LineBreak/> <Run Foreground="White">🧱 </Run><Bold><Run Foreground="LimeGreen">Special object support</Run></Bold><Run Foreground="White"> - includes MLINE coordinate lengths plus REGION and MPOLYGON perimeter values.</Run><LineBreak/> <Run Foreground="White">🔢 </Run><Bold><Run Foreground="LimeGreen">Formatted result</Run></Bold><Run Foreground="White"> - outputs the final length with four decimal places.</Run><LineBreak/> <Run Foreground="White">📋 </Run><Bold><Run Foreground="LimeGreen">Clipboard export</Run></Bold><Run Foreground="White"> - copies the numeric result automatically for immediate paste into Excel or reports.</Run><LineBreak/> <Run Foreground="White">🖥️ </Run><Bold><Run Foreground="LimeGreen">Command line feedback</Run></Bold><Run Foreground="White"> - displays whether one object or multiple objects were measured.</Run><LineBreak/> <Run Foreground="White">🔒 </Run><Bold><Run Foreground="LimeGreen">Non-destructive workflow</Run></Bold><Run Foreground="White"> - reads geometry lengths without changing selected drawing objects.</Run><LineBreak/> <LineBreak/> <Bold><Run Foreground="DodgerBlue">✅ Practical Result</Run></Bold><LineBreak/> <Run Foreground="White">TLength provides a quick AutoCAD and Civil 3D quantity-check workflow for measuring total selected geometry length and reusing the value in documentation, Excel, and BoQ calculations.</Run><LineBreak/> <LineBreak/> <Bold><Run Foreground="DarkRed">⚠️ Important Notes</Run></Bold><LineBreak/> <Run Foreground="White">The result uses the current drawing units and does not perform automatic unit conversion.</Run><LineBreak/> <Run Foreground="White">The tool returns one combined value only; it does not split the result by layer, object type, color, or linetype.</Run><LineBreak/> <Run Foreground="White">MLINE length is calculated from coordinate segments, so complex multiline visual styles may need manual review.</Run><LineBreak/> </TextBlock> <!-- Use MediaElement for GIF (static first frame) and Image as fallback --> </StackPanel> </src:RibbonToolTip.ExpandedContent> </src:RibbonToolTip> </ResourceDictionary>
