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.
General procedure to create fields
- 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.
- Under Field Names, expand a group, then choose a field name.
The settings for the selected field name appear.
- 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.
- Launch the FIELD command to open the Field dialog box.
- Expand Objects group in the Field names list and select Formula.
- 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 |
- Field Formula: tang(expression)
- Parameters: tan(expression)
To display an entity property in a field
- Launch the FIELD command.
The Field dialog box appears.
- Expand Objects in the Field names list and select Object.
- Click the Select Entity button () on the Field dialog box.
The Field dialog box closes temporarily.
You are prompted: Select Entity:
- Click the entity you want to display a property of.
The Field dialog box appears again.
- Select the entity property in the Property list.
- 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.
- Click the OK button.
- Specify a point to place the field in the drawing.
To edit a field
- Edit the table cell or Mtext entity that contains the field.
- Double click the field.
The Field dialog box appears.
- Adjust the properties of the field.
- Click the OK button to apply the changes.
To update a field
- 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:
- Select the field(s) you want to update, then right click or press Enter.
The selected fields are updated.
To convert a field to text
- Edit the table cell or Mtext entity that contains the field.
- Select the field.
- Right click, then choose Convert Field to Text in the context menu.