Historical Context & Motivation
Engineering drawings have always carried metadata beyond geometry—title blocks, revision dates, author names, scale factors, and sheet counts. Before CAD systems existed, drafters maintained this information by hand, carefully erasing and re-lettering whenever a project evolved. When AutoCAD digitized the drafting process in the early 1980s, annotations became editable text objects, but they were still static strings that required manual updates. A single missed edit—say, forgetting to update the date after a revision—could propagate errors through an entire document set, a scenario familiar to anyone who has debugged a system where state is duplicated rather than referenced.
The core problem Fields solve is one computer scientists recognize immediately: data duplication leads to inconsistency. Rather than storing the same piece of information in multiple static strings, Fields act as live references—pointers, if you will—that resolve to their source value at evaluation time. The question becomes: how do we insert, configure, and manage these dynamic references so that our drawings remain a single source of truth?
Core Principles & Definitions
A Field in AutoCAD is a special text fragment that contains an instruction rather than a literal value. When the drawing regenerates, plots, or is explicitly updated, each Field evaluates its instruction and renders the current result as visible text. The underlying instruction is encoded in a field expression—a format code string stored in the DWG database—while the displayed text is merely a cached snapshot. Think of it as lazy evaluation: the expression is stored, and the rendered value is computed on demand.
Field Expression
Field Category
Field Update Trigger
Gray Background Indicator
Host Objects
Visual Explanation — Field Lifecycle
The following diagram illustrates the lifecycle of a Field from insertion to display. Understanding this pipeline clarifies why Fields sometimes appear stale (the cached value hasn't been re-evaluated) and how the FIELDEVAL bitmask governs refresh behavior.
FIELDEVAL bitmask (step 5)—cause the expression to re-evaluate (step 6) and update the displayed text (step 7).Notice how the trigger step acts as an event dispatcher. The FIELDEVAL system variable is a bitmask where each bit corresponds to an event type: bit 0 (value 1) = OPEN, bit 1 (value 2) = SAVE, bit 2 (value 4) = PLOT, bit 3 (value 8) = ETRANSMIT, bit 4 (value 16) = REGEN. The AutoCAD default value of 31 enables bits 0–4 (OPEN + SAVE + PLOT + ETRANSMIT + REGEN: 1+2+4+8+16 = 31). If you set FIELDEVAL to 0, Fields freeze and behave like static text—useful when you want to lock a snapshot value.
How Fields Work — Under the Hood
AutoCAD Fields are not mathematical formulas in the traditional sense, but they do follow a structured evaluation model that computer scientists will find familiar. Internally, a Field is stored as a field code string embedded within the host object's extended data. This string contains the field type identifier, the data source reference (which could be an object handle, a system variable name, or a LISP expression), and a format specifier. When an update trigger fires, AutoCAD's field evaluator parses this string, resolves the reference, applies the format, and writes the result into the text cache.
Field Code Structure
%< and >% mark the beginning and end of a field expression. \AcVar specifies the evaluator class (e.g., AcVar for system variables, AcObjProp for object properties). The \f switch introduces the format string that controls decimal places, date patterns, and text casing.01/15/2025.\AcObjProp requests the Area property of the object identified by handle 2130079768. The format %lu2%pr2 specifies decimal units with two decimal places. If the polyline's area changes, this Field automatically reflects the new value.FIELDEVAL Bitmask Breakdown
Field Categories & Common Use Cases
AutoCAD organizes Fields into several categories, each exposing a different namespace of data sources. Understanding these categories is essential for selecting the right Field type for a given annotation task. The diagram below maps each category to its typical use cases and the type of data it exposes.
| Category | Data Sources | Typical Placement | Example Output |
|---|---|---|---|
| Date & Time | CreateDate, SaveDate, PlotDate, Date (current) | Title block revision date, plot stamps | 01/15/2025 |
| Document | FileName, FilePath, FileSize, Author, Title, Subject | Title block drawing name, file reference notes | FloorPlan-A101.dwg |
| Objects | Area, Length/Perimeter, Layer, Color, Position, custom properties | Room area labels, pipe length schedules | 245.50 sq ft |
| Sheet Set | SheetNumber, SheetTitle, SheetSetName, custom properties | Title blocks linked to SSM, sheet indices | Sheet A-101 |
| Other / Plot | PlotScale, DeviceName, PaperSize, LISP expressions, system variables | Scale indicators, plotter stamps, computed values | 1:50 |
Worked Example — Building a Self-Updating Title Block
In this example, we will create a title block attribute that automatically displays the current file name and the date of the last save—eliminating two of the most commonly forgotten manual updates in production drawings.
BEDIT and select the title block definition). This opens the Block Editor environment where you can modify attribute definitions.Insert Field from the context menu to launch the Field dialog. (In some AutoCAD versions and UI configurations, Ctrl+F may also open the Field dialog, but the right-click context menu method is the most consistently available approach across versions.)Filename. Under Format, choose Filename only (excludes path and extension) or leave the full path if desired. Click OK to insert the field expression into the attribute default.%<\AcVar Filename \f "%fn1">%SaveDate. Choose the date format M/d/yyyy from the format examples. Click OK.%<\AcVar SaveDate \f "M/d/yyyy">%Ctrl+S) and run REGEN to see the Fields update to current values. Try renaming the file with Save As—the FileName Field automatically reflects the new name.FloorPlan-A101, LAST_MODIFIED = 1/15/2025Strengths, Limitations & Comparisons
Fields are a powerful automation tool, but like any abstraction they come with trade-offs. Understanding when to use Fields versus static text—or when to reach for a more advanced solution like data extraction or LISP routines—requires weighing their strengths against their limitations.
| Aspect | Strengths | Limitations |
|---|---|---|
| Data Consistency | Single source of truth—eliminates copy-paste errors across multiple annotations referencing the same property. | Fields display a cached value between updates, which may temporarily show stale data if FIELDEVAL is restricted. |
| Maintenance | No manual edits needed when file names, dates, or geometry change—reduces revision overhead. | If the source object is deleted, the Field shows "####" (broken reference). Debugging requires identifying the orphaned field expression. |
| Portability | Fields travel with the DWG file—no external dependencies for document-level fields (Date, FileName). | Sheet Set fields require the .dst file to be accessible. Object fields use internal handles that break if the referenced object is in an XREF that is unloaded. |
| Complexity | GUI-based insertion via the Field dialog requires no programming knowledge. LISP-based field expressions enable custom computations. | Advanced field expressions (nested fields, LISP) have opaque syntax. The raw field code is difficult to read and debug without documentation. |
| Performance | Lightweight—each field is just a string expression. Hundreds of fields have negligible impact on file size. | In drawings with thousands of Object-type fields, REGEN time can increase noticeably as each field queries the database for its source object. |
Connection to Advanced Topics
Fields are an introductory mechanism in a broader ecosystem of dynamic data management within AutoCAD and related Autodesk products. Understanding where Fields fit—and where they hand off to more powerful systems—provides a roadmap for deeper exploration.
| Feature | Fields (This Lesson) | Advanced Alternative |
|---|---|---|
| Data Source | System variables, object properties, document metadata, dates | Data Links connect table cells directly to Excel spreadsheets for bidirectional data exchange |
| Aggregation | One field references one source value—no aggregation or filtering | DATAEXTRACTION wizard queries multiple objects, filters by property, and outputs structured tables or CSV files |
| Computation | Format masks and basic LISP expressions within field codes | Full AutoLISP or .NET API routines can perform arbitrary computation and write results back to drawing entities |
| Multi-drawing scope | Sheet Set fields span drawings within a .dst, but individual fields are DWG-scoped | BIM platforms (Revit) maintain a parametric database across the entire project model, with schedules as live views |
| Update Model | Event-triggered (FIELDEVAL bitmask)—pull-based evaluation | Reactor-based LISP and .NET event handlers provide push-based, real-time notification when objects change |
As you progress, you will encounter nested fields (a field expression that contains another field as a sub-expression), formula fields within table cells (which combine field references with arithmetic operators like SUM and AVERAGE), and LISP-evaluated fields that execute arbitrary AutoLISP code at evaluation time. These advanced patterns transform Fields from simple property lookups into a lightweight scripting layer embedded directly in your annotations—much like moving from simple variable interpolation in a template engine to inline computed expressions.
Practice Problems
Summary — Fields for Automatic Values
AutoCAD Fields are dynamic text placeholders that replace static, manually-typed annotations with live references to drawing data. They can be embedded in MTEXT, table cells, block attributes, and other text-hosting objects. Each Field stores a field expression that specifies a data source (drawn from categories like Date & Time, Document, Objects, Sheet Set, or Other) and a format mask that controls how the resolved value is displayed.
The FIELDEVAL bitmask governs when Fields re-evaluate—on open, save, plot, ETRANSMIT, or regen—giving users control over the balance between data freshness and performance. Fields are inserted via the right-click context menu's Insert Field option (or Ctrl+F in supported contexts) within any text editor, or through the FIELD command. They eliminate the data duplication problem by acting as live references rather than copied values—ensuring that title blocks, schedules, and annotations remain synchronized with the drawing's current state. For CS students, Fields can be understood as a lightweight reactive data-binding mechanism embedded directly in AutoCAD's annotation layer.