%  platform  category

## Inventor trick - conditional parameters (without iLogic)

Even without iLogic you can use a math trick in Inventor to set a parameter value based on a logical condition, depending on the value of another parameter.

Strictly speaking it is not about a logical condition, but rather about testing of divisibility by two, using the standard arithmetic operator modulo (%):

The expression:

v%2

returns 1 for odd values of v

and the expression:

(v+1)%2

returns 1 for even values of the parameter v.

By combining these two expressions you can form a "logical" conditional statement, which evaluates to H1 for odd values of v and to H2 for even values of v:

(v%2)*H1+((v+1)%2)*H2

Analogically you can extend this method also for other values but the resulting expression may get complicated fast.

applies to: Inventor ·

 See also: Tip 10889: How to get user's full domain name, phone No., department, e-mail... Tip 10790: Long text is not wrapped automatically to 2 lines in my title block. Tip 10721: How to draw a catenary or other parametric curve in Inventor? Tip 10719: How to add the unfold rule name as a drawing note? Tip 10161: Automatic checking of design limits in Inventor.