FIELDMATH builds a live calculation from numbers already on the drawing. Pick a piece of text holding a number, choose an operator, pick another, and keep going. The result is a field that recalculates itself whenever any of the numbers it references changes.
What FieldMath does
The obvious use is a schedule total that must never fall out of step with the figures above it — or a rate multiplied by a quantity, where both live elsewhere on the sheet and either might be revised.
What can be picked: Text, MText, attributes, multileaders and dimensions — anything holding a number. A dimension contributes its measurement, so the calculation follows the geometry rather than any typed override. The Constant option lets you type a number in directly, for a rate or a factor that is not written anywhere on the drawing.
Add, Subtract, Multiply and Divide. Undo removes the last term; Result finishes and places the field. The running expression is echoed at the command line as you build it, so you can see what you have so far.
Where the result goes: pick a point for new MText, click a table cell, or choose Object to write into existing text, an attribute, a block or a multileader.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
FIELDMATH. - Pick the first number, or choose Constant and type one.
- Choose an operator, then pick the next number. Repeat as needed — the expression is echoed as you go.
- Use Undo to drop the last term if you mis-pick.
- Choose Result, then pick a point, a table cell, or an existing object to write into.
How it works
Nested fields are handled deliberately, and it matters more than it looks. If you pick a piece of text that is itself a field, the default is to reference that field’s underlying expression directly rather than its displayed text.
The reason is rounding. Displayed text is formatted: a value of 12.3456 shown to two decimals reads 12.35. Calculating from the rounded figure rather than the real one compounds the error at every step, so a total built from six such values can be visibly wrong while every figure on the sheet looks right.
Set FieldMath:UseNested to nil if you genuinely want to reference the displayed text instead — there are cases where the rounded figure is the one that should be added, and the choice is left to you.
A dimension contributes its measurement rather than its text for the same reason: the calculation should follow the geometry, not what somebody typed over it.
Notes and limits
- Dimensions contribute their measurement, not any override. That is a feature — see DIMTATTLE for why overridden dimension text should not be trusted.
- Nested fields reference the real value by default. Change
FieldMath:UseNestedonly if you specifically want the rounded, displayed figure. - Deleting a referenced object breaks the field, which then displays
####. - Fields update on regeneration, governed by
FIELDEVALandFIELDDISPLAY.
Download and details
| Name | FieldMath — build a live calculation from numbers already in the drawing |
| Download | FieldMath.lsp — 31.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | FIELDMATH |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install. |
| Source size | 31.0 KB, 726 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| Compatibility | AutoCAD (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. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- FIELDGRAFT LISP — copy the finished field onto other objects
- AREASUM LISP — a live field totalling areas rather than text values
- DIMTATTLE LISP — find the overridden dimensions this routine ignores
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program