Logical and mathematical expressions in relations
You can enter either discrete values (a number) or mathematical expressions for value relations. You can also link one relation to another by using the name of another relation as a variable within the expression. This is useful when modeling systems with linked components.
The name of another relation can be used as a variable, and the relation name is replaced with the value of the relation.
If/then/else statements can be entered in the form:
if condition then expression else expression
The expressions in the then/else clause should evaluate to a value that can be assigned to the value relation or variable.
The conditional operators are:
• ==
• !=
• <
• <=
The following expression causes a hole to move to 25mm if the distance z=30, otherwise it remains at 5mm (where z=3*x):
if z==30 then 25 else 5
An if/then/else form may also be nested. For example:
if condition-1 then expression-1 else if condition-2 then expression-2 else expression-3 else expression-4
To enter a mathematical expression,
1. Click
Relations and then, in the
Create & Modify group, click
Variable . The
Distance Variable dialog box opens.
2. Click Exp to display the Expression editor.
3. Type your mathematical expression.
Double-click an existing relation to enter it as a variable.
4. Click Apply to save the expression.
This site works best with JavaScript enabled