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 options, and define decimal precision. • Entity selection Prompts you to select relevant entities, then sums their geometric length or area depending on the chosen mode. • Expression building Builds a term by term expression like v1+v2+v3 using the chosen decimal precision. • Excel output Converts the expression to =expression or =ceiling(expression,5) according to the selected Excel options and copies it to the clipboard. • MText creation If enabled, asks for an insertion point and creates MText in the current UCS reading either just the single value or the full expression with its total.
Helper function: (if any)
Helper functions • writeLengthAreaDCL Dynamically writes the DCL file that defines the dialog with radio buttons, toggles, and precision edit box. • radioLengthAreaDCL Loads the DCL, initializes default values, captures user choices, and stores them in global variables. • copy-to-clipboard Uses a hidden htmlfile object to copy plain text or Excel formulas to the Windows clipboard. • format-excel-expr Wraps the raw expression as =expression or =ceiling(expression,5) depending on the Excel and Excel ceiling toggles. • insert-result-text Converts the picked point from UCS to WCS, then inserts MText containing either only the total (for one entity) or expression equals total (for multiple entities). • TotalLengthDetailed Computes per entity length values, accumulates the total, builds the expression, calls helper functions, and prints a summary for length mode. • TotalAreaDetailed Similar to TotalLengthDetailed but for area, using only suitable closed or area capable entities.
Functionalities:
Functional options in the dialog • Length or Area Radio buttons to choose whether to sum linear lengths or areas. • Excel When checked, the clipboard expression is prefixed with an equal sign for direct use in Excel. • Excel ceiling When checked, wraps the expression in a ceiling call with step 5, overriding the simple Excel option. • Place result in Acad When checked, prompts for an insertion point and creates MText showing the numeric result inside the drawing. • Decimal precision Edit box where you specify the global number of decimal places used in expressions, MText, and command line output, default value is 2.
Result:
Result in practice • Clipboard You can immediately paste an Excel compatible formula such as =ceiling(10.25+5.75,5) into a worksheet. • Drawing annotation The routine optionally places a UCS aware MText label like 10.25+5.75=16.00 for multiple entities or just 16.00 when a single entity is selected. • Feedback Command line messages display the summed length or area with the same configured precision.
Images, animations etc.
Log in to download.
Log in
Log in
Additional info:
Learn more: Open Initial Website Source Code
Share this page:
Subscribe
Login
0 Comments
Oldest
