CAD FORUM - TIPS & TRICKS | UTILITIES | DISCUSSION | BLOCKS | SUPPORT | HELP & ASSISTANCE
Over 1.120.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
The new Beam calculator, Spirograph generator and Regression curves in the Converters section.
New AutoCAD 2027 commands and sys.variables
CAD tip # 9630:
Question
A
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.

Inventor
8.1.2014
16288×
this tip shared by ARKANCE experts applies to: Inventor ·
![CAD Forum - ARKANCE Community - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

What is the ARKANCE Community?