• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

AREASUM LISP: Live Field Totalling Areas in AutoCAD

August 3, 2026

A typed area figure is out of date the moment somebody stretches a boundary. AREASUM writes a live field instead — select any number of closed objects, pick a point, and the total appears as text that updates itself whenever the geometry changes.

What AreaSumField does

Select the objects, pick a point, and an MText field is created there showing their combined area. Stretch one of the boundaries and the figure follows on the next regeneration. Nothing has to be remembered and nothing has to be retyped.

Pick inside a table cell and it fills the cell. If the point you pick falls inside an AutoCAD table cell, the field goes into that cell rather than being created as loose MText floating on top of the table. That one behaviour is what makes this directly usable for building an areas schedule by hand, cell by cell.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type AREASUM.
  3. Select the closed objects whose areas you want totalled.
  4. Pick a point for the result. If that point is inside a table cell, the field goes into the cell instead.

How it works

For a single object the field is a straightforward object-property reference to its Area — the same thing you would get from the Insert Field dialog, without the dialog.

For several objects an arithmetic expression field is built that adds the areas together: literally area of A + area of B + area of C, expressed in field syntax. The whole sum is then formatted once at the end rather than each term being formatted and the results concatenated, which is what keeps the displayed figure consistent.

The formatting is controlled by AreaSumField:Format near the top of the file. Two codes do the work:

%lu6 — linear units in decimal format.
%qf1 — suppress trailing zeros.

Edit it to suit your output. %lu6%pr2, for instance, forces two decimal places instead of trimming them. The quickest way to discover the code you want is to build a field you like the look of through the normal dialog and then run FIELDCODE on it — it reports the formatting string, which you can paste straight in.

Notes and limits

  • The objects must be closed for AutoCAD to report an area at all. Open polylines have no area to reference.
  • Fields update on regeneration, governed by FIELDEVAL and FIELDDISPLAY. If a figure looks stale, a REGEN will settle it.
  • Deleting a referenced object breaks its part of the sum. The field shows #### where the missing reference was.
  • The result is in drawing units squared. Millimetre drawings report square millimetres; convert in the format code or schedule with AREATABLE, which has a conversion factor.

Download and details

NameAreaSumField — a live field showing the combined area of several objects
DownloadAreaSumField.lsp — 10.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandAREASUM
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size10.3 KB, 261 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • AREATABLE LISP — number areas and build the whole schedule
  • AREATOTAG LISP — push an area field into a block attribute
  • FIELDSNOOP LISP — report the formatting code of any existing field
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in