IF functions

IF functions check if the value of an argument expression (Arg) falls within one value interval [E1 – E2] and returns the respective predefined value [R]. If Arg falls outside the specified interval, the function returns 0.00.

Function pattern

The function pattern of an IF function is as follows:

IF (E1, Arg, E2, R)

As a graph:

Еxample

A=IF(3, Arg, 7, 15)

As a graph:

In a table:

FOR A IS
Arg = 3 0
3 < Arg ≤ 7 15
7 < Arg 0

Application

Explore two examples for how to use IF functions while designing resizable structures.

Example 1: Setting parameter values to zero

Look at the following structure:

What's tricky here is that if the flap is longer than the height of the tray, we need an additional cut to be able to remove the waste easily. If the flap is shorter than the tray height, no cut is needed. To remove the cut, we can set to zero the parameters that are linked to the cut: DxUT and DyUT.

We must set these parameters to zero in case the flap is shorter than the tray height. That is,

WHEN DxUT and DyUT Should Take
FH > H + LSC (FH – H – LSC > 0) 3
FH ≤ H + LSC (FH – H – LSC < 0) 0

For this purpose, we shall use an IF function in the parameters' expressions as follows:

DxUT = if(0; FH-HssY – UL*LSC; 1000; 3)

DyUT = if(0; FH-HssY – UL*LSC; 1000; 3)

As a graph:

NOTE: Since the function requires two extremes, we set the supposedly unreachable value of 1000.

As a table, the function works as follows:

FOR DxUT Is DyUT Is
FH – (H + LSC) ≤ 0 0 0
0 < FH – (H + LSC) ≤ 1000 3 3
FH – (H + LSC) > 1000 0 0

NOTE: This set-to-zero-value approach is used in the resizable designs 0422 Tray with Self Locking Wall.evr and 0435 Tray with Self Locking Wall.evr from the EngView Library of Resizable Designs.

Example 2: Switching flaps with an IF function and the Conditional Visibility property

We can modify the shape of the flap by means of a different technique, in which we can use the component's Conditional Visibility property. This approach frees us from resetting the values of parameters; we proceed directly by substituting one set of flaps with another.

Look at the following structure:

Here the flaps' height is set at half that of the tray (FH=W/2). In the case in which the flap height is smaller than the height of the tray, a change is required in the shape of the tray.

In other words, when FH–(H+LSC) is smaller than or equals 0, Flap1 must be substituted with Flap2.

For this purpose, two sets of flaps are attached to the structure. Each set has a condition for when it needs to be visible. This condition is set through a property called Conditional Visibility, which ensures that Flap1 and Flap2 get switched.

When the Conditional Visibility property of a flap is 'yes' (equals 1), the flap is visible; when the property is 'no' (equals 0), it is hidden and disappears from the graphical area.

In this case, we create a parameter, ChangeFlap, which can have the values 0 and 1.

FOR ChangeFlap Should Take
FH – (HY + LSC) < 0 1
FH – (HY + LSC) > 0 0

Here is when we use the IF function.

ChangeFlap = IF(–1000; FH – (HY + LSC); 0; 1)

As a graph:

NOTE: Since the function requires two extremes, we set the supposedly unreachable value of –1000.

In a table, the function works as follows:

FOR ChangeFlap Is
FH – (HY + LSC) < –1000 0
–1000 < FH – (HY + LSC) < 0 1
FH – (HY + LSC) > 0 0

We will use the new parameter in the flaps' Conditional Visibility properties: