Change variable properties by using conditions
- Last UpdatedSep 10, 2025
- 2 minute read
You can use conditions to create duplicate variables with the same name so that the condition can set the properties of the variable. You can change the variable's Type, Favorite, Required, Default Mode Specification, Default Value, Min and Max. This feature is known as replaceable variables, since the condition is used to replace the variable with a different one with the same name with different properties.
The following example will instruct you how to create three replaceable variables with conditions that will allow you to switch between pressure, temperature or mass flow.
Create a replaceable variable
-
Edit or create a new Model Type in the Model Editor.
-
Expand the Parameters section and add a new parameter.
-
Enter Type as the parameter Name.
-
Select Enumeration as the Type.
-
Select a Default value.
-
Add Pressure, Temperature, and MassFlow as Values. Press the Enter key after entering in each value to save your entry.

-
Expand the Conditions section.
-
Add a condition with PC as the condition Name and an Expression of Type = Pressure.
-
Add a condition with TC as the condition Name and an Expression of Type = Temperature.
-
Add a condition with WC as the condition Name and an Expression of Type = MassFlow.

-
Expand the Variables section.
-
Add a variable with PC as the Condition, PV as its Name, and Pressure as the Type.
-
Add a variable with TC as the Condition, PV as its Name, and Temperature as the Type.
-
Add a variable with WC as the Condition, PV as its Name, and Mass Flow as the Type.
-
Set the Min, Max and Default values for each variable.

-
In the Property Inspector or Simulation Manager, change the Type parameter and note that the properties for the specified variable dynamically change based on the parameter selection.
