Working with fields

A field is a text entity which contains instructions to display the status or property of another entity or setting in the drawing. When a field is updated it displays the latest value of the data source it refers to. Fields can be used to insert drawing properties, custom properties or object properties in multiline texts or tables or as an attribute in a block. Fields in attributes are especially useful in title blocks: using drawing, sheet set, subset and sheet properties title blocks can be filled out automatically.

See the DWGPROPS command to learn more about default and custom drawing properties.

See the SHEETSET command to learn more about default and custom sheet set, subset and sheet properties.

If no value is available, a field displays hyphens (----).

If the FIELDDISPLAY system variable is ON, fields are displayed on a light gray background which does not print.

The FIELDEVAL system variable controls when fields are updated.

Note: Date fields are only updated by the UPDATEFIELD command; they are not automatically updated based on the FIELDEVAL system variable value.

General procedure to create fields

  1. Do one of the following:
    • Click the Insert Field tool button () on the Insert toolbar and the Annotate / Text ribbon panel.
    • Choose Insert Field... in the Insert menu.
    • Launch the FIELD command.
    • Click the Field tool button () on the Text Formatting toolbar when creating or editing Mtext or a table cell content.

    The Field dialog box appears.

  2. Under Field Names, expand a group, then choose a field name.

    The settings for the selected field name appear.

  3. Adjust the settings, then click the OK button.

    The Field dialog box closes.

    The field is created in the Mtext or table cell being edited.

    or

    You are prompted: Specify start point or [Height/Justify]:

    Do the following:

    • (option) Type H or choose Height in the context menu to define the text height.
    • (option) Type J or choose Justify in the context menu to set the text justification.
    • Specify the insertion point of the field in the drawing.

    An Mtext entity containing the field is created.

Working with Field Formula

Field Formula refers to functions and operations that can be used in the Field dialog box.

  1. Launch the FIELD command to open the Field dialog box.
  2. Expand Objects group in the Field names list and select Formula.
  3. In the Formula field you can insert different types of operations and formulas. The result will be shown in the Field value field.

The following table shows the operations that can be used in the Field Formula.

Operation Character Description
Addition + Produces the sum of numeric values.
Subtraction - Subtracts the two numeric values.
Multiplication * Multiplies the numeric values.
Division / Divides two numeric values.
Exponentiation ^ Calculates the exponential value of the given numbers.

The following table shows the functions that can be used in the Field Formula.

Function Syntax
Cosine cos(expression)
Sine sin(expression)
Tangent tang(expression)
Arc cosine acos(expression)
Arc sine asin(expression)
Arc tangent atan(expression)
Square sqr(expression)
Square root sqrt(expression)
Round to nearest integer round(expression)
Truncate decimal trunc(expression)
Absolute value abs(expression)
Degrees to radians d2r(expression)
Radians to degrees r2d(expression)
Logarithm, base e ln(expression)
Logarithm, base 10 log(expression)
Exponent, base e exp(expression)
Exponent, base 10 exp10(expression)
Pi = 3.14… pi
Note: The syntax for Tangent function in Field Formula is slightly different from the one in Parameters:
  • Field Formula: tang(expression)
  • Parameters: tan(expression)
Note: Square of a number, sqr(expression), is available only in Field Formula.

To display an entity property in a field

  1. Launch the FIELD command.

    The Field dialog box appears.

  2. Expand Objects in the Field names list and select Object.
  3. Click the Select Entity button () on the Field dialog box.

    The Field dialog box closes temporarily.

    You are prompted: Select Entity:

  4. Click the entity you want to display a property of.

    The Field dialog box appears again.

  5. Select the entity property in the Property list.
  6. Set the display layout:
    • Format: choose a unit format.
    • Precision: select a precision in the list button
    • Convert: this option allows to recalculate the field value.
      • Choose a formula in the list; e.g. f*#, where f is the factor you type in the Convert field and # is the field value.
      • Type a factor in the Convert field; e.g. 0.0001 to express the area of a polyline in square meters in a cm drawing.
  7. Click the OK button.
  8. Specify a point to place the field in the drawing.

To edit a field

  1. Edit the table cell or Mtext entity that contains the field.
  2. Double click the field.

    The Field dialog box appears.

  3. Adjust the properties of the field.
  4. Click the OK button to apply the changes.

To update a field

  1. Do one of the following:
    • Click the Update Field tool button () on the Redraw / Regen toolbar.
    • Choose Update Fields... in the Tools menu.
    • Launch the UPDATEFIELD command.

    You are prompted: Select field(s) to update:

  2. Select the field(s) you want to update, then right click or press Enter.

    The selected fields are updated.

Note: If bitcode 16 of the FIELDEVAL system variable is set, executing the REGEN command updates all fields in the drawing.
Note: Date fields are only updated by the UPDATEFIELD command; they are not automatically updated based on the FIELDEVAL system variable value.

To convert a field to text

  1. Edit the table cell or Mtext entity that contains the field.
  2. Select the field.
  3. Right click, then choose Convert Field to Text in the context menu.