A room tag that carries a typed area is wrong as soon as the wall moves, and nobody notices until the schedule is checked. AREATOTAG pushes the area — or the sum of several areas — into a block attribute as a live field, so the tag tells the truth by itself.
What AreaToTag does
Select the boundaries, then pick the attribute or the block that contains it, and the attribute is populated with a field showing the total area. Because it is a field rather than typed text, editing the boundary updates the attribute automatically.
This is how you build a room tag that stays correct: the room name is typed, the area is a field, and stretching the wall updates the tag without anyone having to remember to.
You can pick either the attribute itself or the block that holds it. If the block has exactly one attribute, that one is used without further prompting. If it has several, a list is shown to choose from — so you never have to zoom in far enough to click one specific attribute out of a crowded tag.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
AREATOTAG. - Select the boundary or boundaries whose area you want.
- Pick the target attribute, or anywhere on the block containing it.
- If the block holds more than one attribute and no preset is configured, choose which one from the list.
How it works
The field written into the attribute is an object-property reference to the boundary’s Area, or an arithmetic expression summing several of them. Because the reference is to the object rather than to a number, the attribute re-evaluates whenever the drawing regenerates.
Presetting a tag skips the selection list. Set AreaToTag:Tag near the top of the file to an attribute tag name — “AREA”, say — and that attribute is used automatically whenever the picked block has one. Leave it nil to always be asked. On a project with a standard room tag, setting it once removes a prompt from every single use.
The number display is controlled by AreaToTag:Format: %lu6 for decimal linear units and %qf1 to suppress trailing zeros. Run FIELDSNOOP on a field whose appearance you like and it will report the code that produced it.
Notes and limits
- The block must already have an attribute to write into. This populates an existing attribute; it does not add one.
- Constant attributes cannot hold a field. They live in the block definition rather than the insertion, so there is nothing per-instance to write to.
- The boundaries must be closed objects for AutoCAD to report an area.
- Deleting a referenced boundary breaks the field, which then displays
####. That is a feature when checking a set — a broken tag is visible, whereas a typed number that has gone stale is not.
Download and details
| Name | AreaToTag — write an area into a block attribute as a live field |
| Download | AreaToTag.lsp — 13.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | AREATOTAG |
| 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 | 13.6 KB, 328 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
- AREASUM LISP — the same live total as MText or into a table cell
- AREATABLE LISP — number areas and build a full schedule
- TAGTINT LISP — recolour attribute tags across many blocks at once
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program