MicroStation CONNECT Edition Help

Expressions

An expression is a text string that defines the syntax to be evaluated by the expression evaluator. The expression input can comprise of numbers, strings, access strings, symbols, and operators. Once you attach an item type with an expression defined, the corresponding value of the expression will display in the element's Properties dialog.

You can access this feature from the Property Definition section in the Item Types Dialog by selecting an Item's property definition.

Ribbon: Drawing > Attach > Item Types > Item Types dialog launcher.


Expression components

An expression is built up from left to right, using parentheses to explicitly call functions or group operations. Following are the components of an expression:
  • String - "Pipe"
  • Integer - 1
  • Double - 6.84
  • Symbol - you can use symbols to supply values to expression evaluators. Symbols can be from an instance via an access string, defined value, or an application defined method. Following are a few examples:
    • Instance - "ActiveFile.Author". An access string is a limited expression that contains no blank spaces, operators or variable portions.
    • Value - "System.Math.PI"
    • Method - "System.Math.Sin(1.57)"
  • Operators -
    • Comparison - <, >, <=, >=, =, and <>
    • Conditional If (conditional, true-result, false-result)
    • Arithmetic ^ (exponentiation), *, /, \, Mod, +, and -. The division operator "/" always produces a result of type double. The division operator "\" always produces an integer result.

Use last Valid Value

If set to True, will display the previous value for the property in the Properties dialog. If set to False, will display the current value.

Note: Item Type libraries created using Expressions in Update 13 will not be compatible with Units and Use last valid value fields in Update 15. To overcome this, you must use the key-in Itemtype Upgrade All.

This key-in will upgrade item types from older libraries and will make them compatible with Units and Use last valid value fields.

Failure Value

In this field you can type in the value that will be displayed in the item's properties if the expression fails to execute. You can type in the desired failure value in the Failure Value field in the Expression section of Item Types dialog.




Grade - displays the failure value "Not Valid" since "LengthX" is not a valid entry in the expression