Use expressions to set the text or the display properties of the annotation. Some of the items that can use expressions are:
- Annotation text
- Text color
- Text size
- Rotation angle
- Position relative to the drawing object being annotated
AnnotationTemplate.SetExpressionString() sets properties for the entire template. Annotations.SetExpressionString() sets properties for annotation text within the block.
Expressions are evaluated by the AutoLISP interpreter, and return a single value. Depending on the property being set, the value can be numeric or string. If the expression cannot be evaluated properly it displays the attribute tag name instead.
The enum Annotation.AnnotationExpressionFields contains the complete list of fields that can use expressions.
In most cases, expressions are used to define the text of the annotation, but they can also be used to define things like color, size, or position.