AutoCAD – Drawings

The field command in AutoCAD: figures that follow the geometry

The field command in AutoCAD ties a figure to the geometry itself, so editing the shape rewrites the text. Measured: 3 million becomes 4.5 million, untouched.

  • TS. Đỗ Quốc Hoàng
  • 8 min read
Stretching the polyline from 2000×1500 to 3000×1500 changes the text from 3,000,000 to 4,500,000 by itself Photo: Diagram by the Institute of Information Technology in Civil Engineering

A room area schedule on a floor plan is the single most error-prone thing in a drawing set. Not because anyone calculates wrongly, but because the plan changes and the schedule is forgotten. The architect moves a wall 200, the room area changes, the schedule keeps the old figure, and that figure goes straight into the cost plan.

The field command in AutoCAD breaks that chain: it ties the figure on the drawing to the geometry itself, so editing the shape rewrites the text. This article measures it once, properly, to show it really does change. For the whole approach to annotation and scheduling from drawings see our AutoCAD for Construction course.

What a data field actually is

Ordinary text holds dead characters: type 3000000 and it stays three million for ever, however the shape beside it changes.

A data field is different. It holds no figure at all — it holds a question: "what is the area of that polyline". Every time the drawing regenerates, the program asks again and writes out the current answer.

Fields can ask about more than areas:

GroupWhat gets used on construction drawings
Object propertiesarea, perimeter, length, radius, coordinates
Drawing informationfile name, path, date last saved, who saved it
Sheet informationsheet number, sheet count, view name
System variablesplot scale, units, the value of any variable

The third group saves the most on a multi-sheet set: the sheet number in the title block follows along on its own, with nothing to correct when a sheet is inserted mid-set.

Where to start it

Way inWhat to use
Full commandFIELD
Aliasnone
While editing textright-click in the text editor and choose Insert Field
Keyboard, inside the text editorCtrl + F

The third route is the one that gets used: while typing a note, drop a field into the middle of the sentence, as in Area: <field> m². Text and the text editor are covered in our article on text in AutoCAD.

Measuring it once: does the figure really change

This is the check worth doing before trusting any automatic mechanism.

Draw a closed polyline of 2000 × 1500, whose area by hand is 3,000,000. Beside it, place a text object carrying a field for that polyline's area.

What was measuredValue
Area by hand3,000,000
Area the program reports on the polyline3,000,000
What the field text readsS = 3000000

A match. Now stretch the polyline 1000 wider, to 3000 × 1500, so the area must be 4,500,000. The text is not touched at all. Regenerate, then read it:

What was measuredValue
Area by hand after stretching4,500,000
What the field text readsS = 4500000
Times the figure was retyped0

It changed by itself. That is what stops an area schedule ever drifting away from the plan again.

Two details of that test are worth naming, because they are what makes it a test rather than a demonstration. The area was worked out by hand first, so there was a figure to be wrong against. And nothing at all was done to the text — no click, no edit, no refresh button — because the whole claim being checked is that the field command in AutoCAD needs no such step. Had the text still read three million, the mechanism would be worthless for exactly the job it is sold for.

A self-updating field Photo: Stretching the polyline from 2000×1500 to 3000×1500 changes the text from 3,000,000 to 4,500,000 on its own

A broken reference shows hashes

The next question has to be asked: if somebody deletes the polyline, does the old figure sit there misleading the reader?

Delete it, regenerate, and the text reads:

S = #######

Hashes, not the old number. That is the good outcome: a field that has lost its object says so at a glance rather than quietly keeping a stale value. Across a drawing set, a row of hashes is far easier to spot than a correctly formatted figure that happens to be out of date.

The fix is either to rebuild the shape and attach a new field, or to replace the text with ordinary characters if the figure no longer has a source.

Self-updating areas on a real job

The three places worth the effort, in order of how often they come up.

Room area schedules. One closed polyline per room on its own layer, one field per area cell pointing at it. The architect moves a wall and the schedule follows. Measuring areas by command is covered in our article on measuring areas in AutoCAD.

Title blocks. Sheet number, sheet count, file name, plot date. Four cells, four places to forget.

Length notes. Pipe runs, road centrelines, fencing — attach a length field to the line itself and extending it rewrites the figure.

There is a fourth use that saves arguments rather than minutes: a note in the corner of each sheet carrying the file name and the date it was last saved. When a contractor queries which revision they are building from, the answer is printed on the sheet and cannot have been forgotten, because nobody typed it. On a job with several consultants issuing drawings, that one field settles more disputes than any amount of revision clouding.

One more decision worth making deliberately, because it decides whether the set stays tidy: put the source polylines on their own layer and turn it off for plotting. Self-updating areas are only trustworthy when each room has exactly one closed boundary, and those boundaries need not appear on the printed sheet. A dedicated layer solves both at once, and the next person to open the drawing sees how it works immediately. Layers are covered in our article on layers in AutoCAD.

What they share: a field is only worth using when the geometry is the source of truth. Where the figure comes from somewhere else — calculated by hand against a standard, say — do not attach a field, because then it will follow the shape and be wrong.

The dataextraction command: a whole table at once

A field solves the problem of one figure. When a whole table is needed — counting blocks, listing attributes, totalling areas in bulk — there are other commands.

CommandAliasWhat it does
DATAEXTRACTIONDXPulls properties of many objects into a table
DATALINKDLTies a table in the drawing to an Excel file

The dataextraction command runs as a sequence of questions: choose the source, choose the object types, choose the properties to take, then send the result to a table in the drawing or out to a file. What comes back is a genuine AutoCAD table rather than loose text.

The datalink command works the other way round. Autodesk's page states: "A table can be linked to data in a Microsoft Excel (XLS, XLSX, or CSV) file." Edit the spreadsheet, update the link, and the table follows.

Three tools, three directions of travel: a field takes its figure from the geometry, extraction takes figures from many objects, and a data link takes them from an outside file. Getting coordinates out of a spreadsheet and into a drawing is covered in our article on importing coordinates into AutoCAD.

Five things people say that are not true

What people sayWhat was measured
Fields only handle file names and datesThey handle area, perimeter, length and coordinates of a specific shape
After editing the shape you retype the figure2000 × 1500 became 3000 × 1500 and the text changed itself, retyped 0 times
Delete the shape and the field keeps the old figureIt shows #######
FIELD has an aliasIt has none; inside the text editor press Ctrl + F
A field and a linked spreadsheet are the same thingA field reads the geometry, DATALINK reads an Excel file

Frequently asked questions

How do I drop a field into the middle of a note?

While editing the text press Ctrl + F, or right-click and choose Insert Field. The field then sits in the sentence like an ordinary word.

The figure did not change after I edited the shape.

Regenerate the drawing. A field takes its new value when the drawing regenerates, not continuously.

The text is all hashes — what happened?

The field lost its object, usually because the shape was deleted. Attach it to new geometry, or replace it with ordinary text.

Do fields print?

Yes, at whatever value is showing. The grey background on screen is only a marker so you can recognise a field; it does not plot.

What if I need a whole table rather than one figure?

Use DATAEXTRACTION, alias DX. It pulls the properties of many objects into a table.

What about a table already built in Excel?

Use DATALINK, alias DL. The table in the drawing is tied to the spreadsheet and updates from it.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction