MicroStation PowerDraft 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.

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