Display Text Preference Usage
There are two kinds of statements:
Statement |
Description |
defines |
Enables naming a display expression for reuse in any following
statement. |
displayTexts |
Declares a display text expression for a given ENOVIA type.
Type statements begin with the following keywords:
- For 3DSpace only:
businessobject
connection
- For all connectors except 3DSpace:
type
These keywords can be abbreviated.
|
Display Text Expression
A display text expression is a string expression that combines the following elements:
- An MQL field of the displayed object. This must be an MQL selectable expression
delimited between curly braces.
Example: {type}
{attribute[Title]}
- A constant string, delimited by quotes. Its syntax is similar to JavaScript strings.
Example: "string"
- A concatenation of elements using the
+
operator. Example:
"hello " + {attribute[Title]} + "!"
- A predefined function call.
Example:
or({attribute[Title]},{name})
- Parenthesis can be used to change the priority of evaluation.
Predefined Functions
The following predefined functions can be used in the display text expressions.
Predefined Function |
Returns |
or(s1, s2, …) |
- First not empty parameter
"" string if all are empty
|
and (s1, s2, …) |
- Concatenation of the parameters if they are all not empty
"" string if one of them is empty
|
not(s) |
"t" string if s is empty
"" string if s is not empty
|
if(c, s1, s2) |
s1 if c is not empty
s2 if c is empty
|
eq(s1, s2) |
"t" string if s1 equals
s2
"" string if they differ
|
Note:
Boolean values are represented using strings, with the following conventions:
- A valuated string is interpreted as Boolean true
- An empty string is interpreted as Boolean false
The functions described in the table above are compatible with these
conventions.