TotalLengthAreaDetailed

Short description

๐Ÿ“๐Ÿ“ AutoCAD AutoLISP utility for calculating total length or total area from selected CAD entities, copying Excel-ready formulas to the clipboard, and placing UCS-aware dynamic MTEXT field results in the drawing.

Image 000 17

Command:

๐Ÿš€ Main command: TotalLengthAreaDetailed. The command opens a DCL dialog where the user chooses Length or Area, Excel output, CEILING rounding, MTEXT placement, decimal precision, and optional Profile_002 profile conversion.

Description:

๐Ÿ“ TotalLengthAreaDetailed is a dialog-driven AutoCAD and Civil 3D measurement utility for quantity takeoff, CAD calculation review, and production documentation. It calculates either total length or total area from supported drawing entities and builds a detailed additive expression such as 1.25+3.50+2.00.

๐Ÿ“‹ The tool copies the final expression to the Windows clipboard as plain text, an Excel-ready formula, or a CEILING formula. This makes it practical for BoQ workflows, quantity checking, Excel reporting, cable route measurement, layer-based calculations, and CAD production summaries.

๐Ÿ“ When Place result in Acad is enabled, the routine inserts MTEXT in the current drawing at a user-picked point. The insertion is UCS-aware and the result can be created as dynamic AutoCAD field text where supported, so selected object values can remain linked to the source entities.

๐Ÿท๏ธ Version 02 behavior places the result MTEXT on the first selected entity layer. The Acad_Length or Acad_Area layer result label also uses the first selected layer name, making the output easier to audit directly inside the drawing.

๐Ÿงฎ Area mode includes optional Profile_002 profile presets such as Profile_002, Profile_003, Profile_004, and Profile_005. These presets convert a summed area expression into a profile-based expression by dividing by the selected internal width.

Helper function: (if any)โ€‹

๐Ÿงฉ Important helper functions:
– writeLengthAreaDCL: creates the temporary DCL dialog.
– radioLengthAreaDCL: handles dialog options, saved settings, toggles, precision, ceiling step, result mode, and Profile_002 profile selection.
– TotalLengthDetailed: processes length-capable entities and builds length expressions.
– TotalAreaDetailed: processes area-capable entities and builds area expressions.
– copy-to-clipboard: writes the final expression or Excel formula to the clipboard using htmlfile COM.
– format-excel-expr: creates plain, Excel, CEILING, or Profile_002 formulas.
– ctc-make-object-field and ctc-build-field-mtext: generate dynamic AutoCAD field text for supported source objects.
– insert-result-text: inserts UCS-aware MTEXT in the active drawing space and places it on the first selected entity layer.

Functionalities:

๐Ÿš€ DCL dialog workflow for choosing Length or Area.
๐Ÿ“ Detailed total length calculation for lines, polylines, arcs, circles, ellipses, splines, mlines, regions, and mpolygons.
๐Ÿ“ Detailed total area calculation for closed polylines, circles, ellipses, regions, hatches, and mpolygons.
๐Ÿ“‹ Clipboard export as additive expression, Excel formula, or CEILING formula.
๐Ÿงฎ Optional Profile_002 profile conversion for profile-width based quantity extraction.
๐Ÿ“ Optional MTEXT placement in AutoCAD using UCS to WCS transformation.
๐Ÿ”— Dynamic AutoCAD field support for object properties such as Length, ArcLength, Circumference, Perimeter, and Area where available.
๐Ÿท๏ธ Version 02 selected-layer behavior for MTEXT placement and layer-labeled results.
๐Ÿ’พ Persistent user settings through CTC_* environment variables.
๐ŸŽฏ Decimal precision and ceiling step controls.
๐Ÿ” Type-based object filtering with safe fallbacks for unsupported field properties.

Result:

โœ… The result is a faster AutoCAD and Civil 3D quantity takeoff workflow: selected entities are measured, a clean expression is built, the value is copied for Excel, and an optional drawing annotation is inserted as MTEXT. Where possible, the MTEXT uses AutoCAD field expressions linked to the selected objects, while unsupported objects fall back to fixed numeric values.

Images, animations etc.

Image 000 17
Pixel

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="TotalLengthAreaDetailed">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: TotalLengthAreaDetailed</Bold>
<LineBreak/>
<Bold>Version: 1 Date: 07.07.2026 11:14:02AM</Bold>
<LineBreak/>
<Hyperlink>N/A</Hyperlink>
<LineBreak/>

<Bold><Run Foreground="DodgerBlue">๐Ÿš€ Function Syntax: TotalLengthAreaDetailed</Run></Bold><LineBreak/>
<Bold><Run Foreground="Orange">Version: SEO-friendly description based on TotalLengthAreaDetailed v02</Run></Bold><LineBreak/>
<Hyperlink>N/A</Hyperlink><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="DodgerBlue">๐Ÿ“˜ SEO Optimized Description</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿ“ TotalLengthAreaDetailed is an AutoCAD and Civil 3D AutoLISP quantity takeoff utility for calculating total length or total area from selected drawing entities.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ“ The routine builds a detailed additive expression, copies the result to the clipboard, and can place the calculation directly in the drawing as UCS-aware MTEXT.</Run><LineBreak/>
<Run Foreground="LimeGreen">โœ… This makes it useful for CAD measurement checks, BoQ preparation, Excel reporting, quantity summaries, cable route measurement, profile calculations, and drawing-based audit annotations.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="DodgerBlue">๐Ÿงฐ Main Command</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿš€ Run </Run><Bold><Run Foreground="Orange">TotalLengthAreaDetailed</Run></Bold><Run Foreground="White"> in the AutoCAD command line.</Run><LineBreak/>
<Run Foreground="White">The command opens a DCL dialog where the user chooses </Run><Bold><Run Foreground="Orange">Length</Run></Bold><Run Foreground="White"> or </Run><Bold><Run Foreground="Orange">Area</Run></Bold><Run Foreground="White"> and configures clipboard, Excel, CEILING, MTEXT, decimal, layer-label, and KK profile settings.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">โš™๏ธ User Workflow</Run></Bold><LineBreak/>
<Run Foreground="White">1๏ธโƒฃ Start the command </Run><Bold><Run Foreground="Orange">C:TotalLengthAreaDetailed</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">2๏ธโƒฃ Select </Run><Bold><Run Foreground="Orange">Length</Run></Bold><Run Foreground="White"> or </Run><Bold><Run Foreground="Orange">Area</Run></Bold><Run Foreground="White"> in the dialog.</Run><LineBreak/>
<Run Foreground="White">3๏ธโƒฃ Configure Excel formula output, CEILING rounding, decimal precision, ceiling step, AutoCAD MTEXT placement, and result label mode.</Run><LineBreak/>
<Run Foreground="White">4๏ธโƒฃ Select supported entities in the drawing.</Run><LineBreak/>
<Run Foreground="White">5๏ธโƒฃ Optionally pick a UCS-aware insertion point for the drawing result text.</Run><LineBreak/>
<Run Foreground="White">6๏ธโƒฃ Use the clipboard expression in Excel or keep the placed MTEXT annotation in AutoCAD.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">๐Ÿ“ Length Mode</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿ“Œ Supported length objects include </Run><Bold><Run Foreground="Orange">LINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">POLYLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">LWPOLYLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">ARC</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CIRCLE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">ELLIPSE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">SPLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">MLINE</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">REGION</Run></Bold><Run Foreground="White">, and </Run><Bold><Run Foreground="Orange">MPOLYGON</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ”— Where possible, the MTEXT result uses dynamic AutoCAD fields for properties such as Length, ArcLength, Circumference, and Perimeter.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">๐Ÿ“ Area Mode</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿ“Œ Supported area objects include closed polylines, circles, ellipses, regions, hatches, and mpolygons.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ”’ Open polylines do not contribute to area because the routine checks closed state before using polyline area.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ”— Where possible, the MTEXT result uses dynamic AutoCAD Area fields linked to the selected objects.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">๐Ÿงฎ KK Profile Workflow</Run></Bold><LineBreak/>
<Run Foreground="White">๐ŸŸง The dialog includes KK profile presets: </Run><Bold><Run Foreground="Orange">KK Gr. I i.F_220X275</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">KK Gr. II i.F_400X275</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">KK Gr. IIIa i.F_515X275</Run></Bold><Run Foreground="White">, and </Run><Bold><Run Foreground="Orange">KK Gr. IV i.F_700X285</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ“Š When a KK profile is selected in Area mode, the expression is converted into a profile-width formula such as </Run><Bold><Run Foreground="Orange">(A+B+C)/0.4</Run></Bold><Run Foreground="White"> before Excel CEILING output is applied.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">๐Ÿ“‹ Clipboard and Excel Output</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿ“ค Base clipboard output is an additive expression such as </Run><Bold><Run Foreground="Orange">1.25+3.50+2.00</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">๐Ÿงพ Excel mode outputs </Run><Bold><Run Foreground="Orange">=expression</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ”ข Excel ceiling mode outputs </Run><Bold><Run Foreground="Orange">=CEILING(expression,step)</Run></Bold><Run Foreground="White"> and has priority over the normal Excel toggle.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">๐Ÿ“ AutoCAD MTEXT Result</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿ“Œ The insertion point is transformed from UCS to WCS, so the annotation is placed correctly in custom UCS workflows.</Run><LineBreak/>
<Run Foreground="White">๐Ÿท๏ธ Version 02 places the MTEXT on the first selected entity layer and uses that same selected layer name in the </Run><Bold><Run Foreground="Orange">Length_Layer</Run></Bold><Run Foreground="White"> or </Run><Bold><Run Foreground="Orange">Area_Layer</Run></Bold><Run Foreground="White"> label.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ”„ Supported objects can generate dynamic field text, while unsupported field-readable properties fall back to fixed numeric values.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="LimeGreen">๐Ÿ’พ Saved Settings</Run></Bold><LineBreak/>
<Run Foreground="White">๐Ÿง  The tool stores dialog preferences using environment variables such as </Run><Bold><Run Foreground="Orange">CTC_LAST_OPTION</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CTC_EXCEL</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CTC_EXCEL_CEILING</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CTC_PLACE_ACAD</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CTC_PREC</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CTC_CEIL_STEP</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">CTC_RES_MODE</Run></Bold><Run Foreground="White">, and </Run><Bold><Run Foreground="Orange">CTC_KK_PROFILE</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">๐Ÿ” The next run opens with the last-used options, which speeds up repetitive CAD quantity takeoff workflows.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="DodgerBlue">โœ… Practical Result</Run></Bold><LineBreak/>
<Run Foreground="White">โœ… TotalLengthAreaDetailed creates a reliable bridge between AutoCAD geometry, Civil 3D production drawings, Excel quantity formulas, and annotated drawing results.</Run><LineBreak/>
<Run Foreground="LimeGreen">๐Ÿš€ The final workflow is faster measurement review, cleaner quantity documentation, better CAD audit trails, and more efficient BoQ preparation.</Run><LineBreak/>
<LineBreak/>
<Bold><Run Foreground="DarkRed">โš ๏ธ Important Notes</Run></Bold><LineBreak/>
<Run Foreground="White">โš ๏ธ Objects outside the command selection filters are not measured.</Run><LineBreak/>
<Run Foreground="White">โš ๏ธ Dynamic field output depends on object property support inside AutoCAD.</Run><LineBreak/>
<Run Foreground="White">โš ๏ธ Clipboard export depends on COM availability for the </Run><Bold><Run Foreground="Orange">htmlfile</Run></Bold><Run Foreground="White"> clipboard method.</Run><LineBreak/>
<Run Foreground="White">โš ๏ธ In Area mode, zero-area or open-polyline contributions are excluded from the additive expression.</Run><LineBreak/>



</TextBlock>
            
<Grid>
<Image Source="Image_000.jpg" Stretch="Uniform"/>
</Grid>

</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>

Additional info:

Share this page:

Leave a Reply

Page Tag: ๐Ÿท๏ธ BoQ

  • TotalLengthAreaDetailed

    Short description Command: Description: Helper function: (if any)โ€‹ Functionalities: Result: Images, animations etc. XAML code: Expand Code โ†“ Select Code Copy 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="TotalLengthAreaDetailed"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: TotalLengthAreaDetailed</Bold> <LineBreak/> <Bold>Version: 1 Date: 07.07.2026 11:14:02AM</Bold> <LineBreak/> <Hyperlink>N/A</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">๐Ÿš€ Function Syntax: TotalLengthAreaDetailed</Run></Bold><LineBreak/> <Bold><Run Foreground="Orange">Version: SEO-friendly description based…

  • TotalLengthPolyline

    โ€”

    by

    Short description Command: Description: Helper function: (if any)โ€‹ Functionalities: Result: Images, animations etc. XAML code: Expand Code โ†“ Select Code Copy 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="TotalLengthPolyline"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: tlen</Bold> <LineBreak/> <Hyperlink>https://gist.github.com/kevinluo201/51450de14f63382c046c6d840bb42c96</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">๐Ÿ“ Description</Run></Bold><LineBreak/> <Run Foreground="White">This AutoLISP program </Run><Bold><Run Foreground="Orange">TLEN</Run></Bold><Run Foreground="White"> calculates and reports the total length…

  • TotalLengthAreaDetailed_vs_01

    Short description Short description Calculates total length or area of selected objects, copies an Excel ready formula to the clipboard, and optionally places a formatted result as MText in AutoCAD using the current UCS. Command: Command name TotalLengthAreaDetailed Description: What it does โ€ข Dialog choice Lets you choose between Length or Area, set Excel related…

  • TotalLengthAll

    โ€”

    by

    Short description Command: Description: Helper function: (if any)โ€‹ Functionalities: Result: Images, animations etc. XAML code: Expand Code โ†“ Select Code Copy 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="TotalLengthAll"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: Elen</Bold> <LineBreak/> <Hyperlink>http://www.asmitools.com </Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">๐Ÿ“ TotalLengthAll</Run></Bold><LineBreak/> <Run Foreground="White">AutoCAD LISP utility for calculating the total length of selected curve-based…

  • TLength

    โ€”

    by

    Short description Command: Description: Helper function: (if any)โ€‹ Functionalities: Result: Images, animations etc. XAML code: Expand Code โ†“ Select Code Copy 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…

  • SumLengthField

    โ€”

    by

    Short description Command: Description: Helper function: (if any)โ€‹ Functionalities: Result: Images, animations etc. XAML code: Expand Code โ†“ Select Code Copy 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="SumLengthField"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: SumLengthField (Current units) / SumLengthField_1 (Current units with 0.001 conversion factor (mm->m))</Bold> <LineBreak/> <Hyperlink>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/length-field-lisp-by-lee-mac-to-modify-gt-old-length-current/m-p/10578203#M56399</Hyperlink> <LineBreak/> <Bold>Program Overview</Bold><LineBreak/> This program offers…

  • PolylineArea

    โ€”

    by

    Short description Command: Description: Helper function: (if any)โ€‹ Functionalities: Result: Images, animations etc. XAML code: Expand Code โ†“ Select Code Copy 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="Polyarea"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: Polyarea</Bold> <LineBreak/> <Hyperlink>https://gist.github.com/kevinluo201/ca895bd422fd6b289993268fc35b3191</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">๐Ÿ“ PolylineArea – AutoCAD Polyline Area Calculator</Run></Bold><LineBreak/> <Run Foreground="White">๐Ÿš€ Run </Run><Bold><Run Foreground="Orange">POLYAREA</Run></Bold><Run Foreground="White"> in the…