The IIF function

About the IIF function

The IIF function checks a condition and outputs a result as a consequence of whether the condition is met (True) or not met (False). Its format is:

IIF(condition, R1, R2)

The following flowchart illustrates how the functions works:

top of page

How to use the function

The following two examples show how you can use the function:

Depending on your case, you can apply the functions in other situations.

top of page

To determine parameter value in parameter expressions

You can use the IIF function in parameter expressions — for example, if you want a parameter's value to depend on the value of another parameter.

In the following example, the value of the NTongues parameter depends on whether the value of the A parameter is smaller than 70 or greater. In the former case, NTongues is 1; in the latter case 2.

The IIF function checks a condition. If the value of A is smaller than 70, this means the condition is True. The value of NTongues is then 1.

If the value of A is 70 or greater, this means the condition is False. The value of NTongues is in this case 2.

top of page

To display text in design frames / print drawings

You can use the IIF function in design frames to make it display the correct text if a condition is met. The following two cases showcase two examples.

Check whether a specified material base type is used

In your design frame, type the function to check whether the material base type of the drawing is corrugated board.

The IIF function checks if the material base type of the OneUp1 drawing is corrugated board. If it is, the condition is True, and EngView displays "yes"; if it is not, the condition is False, and "no" is displayed.

Display text based on whether a parameter value meets a condition

In your design frame, type the function to check whether the material base type of the drawing is corrugated board.

The IIF function checks if the the value of A the in OneUp1 drawing is smaller than 70. If it is, EngView displays "Use Tongue Locking System"; if it is not, "No Tongue Locking System" is displayed.

top of page