Dear all

im struggeling with an if-statement in my equations, that i will use to drive a dimension based upon a diameter of a hole.

It is intended to be used for a standard feature to make a clearance hole for an ejector pin for mould design.

I get a syntax in the equation, and i can't figure out how to do it correctly.

What im trying to opbtain is something like this:

if "cut@sketch1" is between 1 and 2, it should return a value of 5, if "cut@sketch1" is between 2 and 4, it should return a value of 8, if "cut@sketch1" is between 4 and 6, it should return a value of 10 etc.s etc.

this is how i have made the equation (which fails):

= IIF ( "cut@Sketch1" > = 0.4 , 3.5 , IIF ( "cut@Sketch1" < = 1 , 3.5 , IIF ( "cut@Sketch1" > = 1.1 , 5 , IIF ( "cut@Sketch1" < = 1.7 ) ) )

can anyone point me in the right direction?

Thank in advance

Klaus

Hi Klaus

Here's a little tip I always teach to help with nested IIF's.

Start with a single IIF Statement and Copy it to the clipboard.

(gotcha make sure the equals sign is not included)Then Select which term you are working on and Paste on top, this ensures you don't have to worry about your brackets.

So hopefully you can see how this helps to construct the equation and also why I just added a 1 and a 0.

Think of the 1 and 0 as the True/False Result.

So now thinking about logic if the first if statement is True and the second is False then

we have the equivalent of IF Cut >= 1 AND Cut < 2, so the second term is where you put the result you want.

Then just continue pasting into the first term..

Oh but before we do an extra tip when working in any equation is to just enter a simple one first and get the green check.

This is because then your equation is saved so that if you make a mistake you do not lose it.

OK now you have to consider what happens if your cut is Less then 1 OR greater then 10.

ie your maximum and minimum values

Hope that helps...

BTW They are tricky little things and I normally make a mistake the first time I do one so no guarantees I got it right.

There are other ways you could construct this that could read better to a human, for example you can always use AND & OR

like this

IIF("D1@Cut" >= 1 AND "D1@Cut" < 2, 5, ***)

Where the star's show where to repaste...

Good Luck