PTSwitchCase & PTSwitchCondition

<< Click to Display Table of Contents >>

Navigation:  PlantExpressTools > How to use > Calculations > Additional Functions >

PTSwitchCase & PTSwitchCondition

Previous pageReturn to chapter overviewNext page

The two Switch functions are useful when having a lot of different conditions and the use of IIF would just be too long.

PTSwitchCase

With PTSwitchCase you use one property and then you define the case and the return value. You repeat this for all your cases. At the end you define a default value for the case if nothing applies.

Calculations 80

When selecting New the return value is 1.

Calculations 82

PTSwitchCondition

PTSwitchCondition is more flexible. Although, the example below is using the same use case as PTSwitchCase above.

You define a condition and a return value if the condition applies. As soon as the first condition applies, this is the return value you will get. Like with PTSwitchCase above, if no condition applies, the default value at the end will be returned.

Calculations 81

Here we have the same result as with PTSwitchCase.

Calculations 82