Expression Operator
Add an Expression Operator node () under Definitions>Variable Utilities (if Group by Type is active; otherwise, directly under Definitions) to define an operator that evaluates parameterized expressions on specified selections. You add it by right-clicking the Definitions node and choosing Variable Utilities>Expression Operator or by right-clicking the Variable Utilities node and choosing Expression Operator.
The Expression Operator node specifies an operator name, formal argument names and dimensions, a default expression, and a selection where the operator will be defined. Alternate expressions can be defined on subsets of the operator selection (also of lower dimensions) using Operator Contribution subnodes. The defining expressions can in addition to the formal arguments contain any variable and operator names that can be evaluated on the corresponding selection. When the operator is used in a model, different operator expressions may be evaluated depending on where the operator is used, and variables in the expressions may evaluate differently depending on their selections.
Geometric Entity Selection
In this section, define the selection for the expression operator. By default, the Geometry entity level is set to Entire model, meaning that the operator will be available globally.
Definition
In the Expression field, enter the default expression for the operator. This expression is the one that will be used on the parts of the Expression Operator node’s selection that have not been overridden by an Operator Contribution subnode. The expression may contain both the specified formal argument names and other variables, which are assumed to exist on the selection. Press Ctrl+Space to choose from previously defined parameters, mathematical constants and functions, operators, and physical constants that you can insert into the expression at the position of the cursor. The output unit of the operator is derived from the default expression.
In the table of arguments, enter the name of each formal argument in the Argument column and its expected dimensions, in the form of a unit expression, in the Dimensions column. The dimensions are used when deriving the operator’s dimensions and for checking unit consistency when the operator is used in expressions. In the Argument type column, choose Expression to pass the input argument as an expression, or choose Value to pass it by its value. Passing an input argument by value can be useful if it is a spatial coordinate in a component geometry that is then evaluated in another geometry, for example.