Quantity Takeoff & Surveying

How to Measure Total Cumulative Length & Area of Multiple Polylines in CAD

Calculate combined linear cable/pipe runs and total slab areas across hundreds of selected polylines, arcs, and splines in GstarCAD 2027 and AutoCAD.

⚡ Quick Executive Fix

In GstarCAD 2027, run AREA > Add Area > Object (or built-in Express Tool TLE / TotalLength) to sum selected entities, use DATAEXTRACTION to export layer-grouped totals to Excel, or run the C:TOTALLEN AutoLISP routine below.

1. Engineering Root-Cause Diagnosis inside the AC1032 DWG Database

Notice that selecting 50 individual `LWPOLYLINE` cable trenches or `LINE` pipe segments and opening the `PROPERTIES` (`Ctrl+1`) palette displays **`*VARIES*`** in the `Length` and `Area` fields rather than summing them. For quantity surveyors and MEP estimators performing Bill of Quantities (BoQ) takeoffs, summing hundreds of segments manually with a calculator is slow and error-prone.

2. Step-by-Step Resolution Protocol in AutoCAD & GstarCAD 2027

1. Method A: Use GstarCAD 2027's Built-In Total Length & Area Tools

In GstarCAD 2027, run AREATABLE or Express Tools Total Length (`TLE`) to select multiple lines, arcs, polylines, and splines by layer filter and insert an automatically summed takeoff table directly into the drawing.

2. Method B: Cumulative AREA Command (Add / Subtract Mode)

Type AREA, enter A (Add mode), then enter O (Object), and click each closed slab polyline one by one. The command line maintains a running `Total area = ...` accumulator. Press `Enter` and type `S` (Subtract) to deduct interior elevator shaft openings.

3. Method C: Instant One-Second AutoLISP Summation (`C:TOTALLEN`)

Load the `C:TOTALLEN` routine below using `vlax-curve-getDistAtParam` and `vlax-curve-getArea` to compute both total linear length and total enclosed area across 10,000+ selected objects in a single window selection.

3. Automated AutoLISP Diagnostic & Repair Script (C:TOTALLEN)

Load the following production AutoLISP routine into GstarCAD 2027 or AutoCAD via APPLOAD (or add it to gcaddoc.lsp) to automate this repair across affected project files:

(defun C:TOTALLEN ( / ss i ent totalLen totalArea len area)
  (vl-load-com)
  (setq totalLen 0.0 totalArea 0.0)
  (princ "\nSelect curves (Lines, Polylines, Arcs, Circles, Splines) to sum: ")
  (if (setq ss (ssget '((0 . "LINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,SPLINE,ELLIPSE"))))
    (progn
      (repeat (setq i (sslength ss))
        (setq ent (ssname ss (setq i (1- i))))
        (setq len (vl-catch-all-apply 'vlax-curve-getDistAtParam (list ent (vlax-curve-getEndParam ent))))
        (if (not (vl-catch-all-error-p len)) (setq totalLen (+ totalLen len)))
        (setq area (vl-catch-all-apply 'vlax-curve-getArea (list ent)))
        (if (not (vl-catch-all-error-p area)) (setq totalArea (+ totalArea area)))
      )
      (princ (strcat "\n=== QUANTITY TAKEOFF SUMMARY (" (itoa (sslength ss)) " Entities) ==="))
      (princ (strcat "\nTotal Cumulative Length : " (rtos totalLen 2 3) " drawing units"))
      (princ (strcat "\nTotal Cumulative Area   : " (rtos totalArea 2 3) " sq. units"))
    )
  )
  (princ)
)

4. Diagnostic System Variables & Edge-Case Matrix

Failure Symptom / Scenario Command / SysVar Production Remediation Rule
Properties palette shows Length = *VARIES* Run C:TOTALLEN or TLE Ctrl+1 compares properties rather than summing; use curve integration.
Self-intersecting polyline gives wrong area BOUNDARY (BO) Create a clean non-self-intersecting region/polyline before measuring area.
Need live Excel breakdown by Layer DATAEXTRACTION Exports Length, Area, and Layer columns directly to .xlsx pivot tables.

Experience Faster, Corruption-Free DWG Engineering in GstarCAD 2027

Built by Suzhou Gstarsoft Co., Ltd. (SSE: 688657), GstarCAD 2027 features multi-threaded DWG open/save, built-in RegApp/Scale-List scrubbers, and perpetual licensing.

Download GstarCAD 2027 Free Trial → AutoCAD Migration Hub