Over 1.099.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
Try the new precise Engineering calculator.
New AutoCAD 2026 commands and variables.
CAD tip # 9659:
Question
A
You can use iLogic code to automatically adjust parameters of your Inventor model to yield a specific volume or mass of the model. You can use it in iteration loops without calculating the volume mathematically.
This is a concept - a sample code accessing and increasing the d1 parameter by 10% while checking the resulting Volume of the model (you can replace it with Mass):
ThisApplication.CommandManager.ControlDefinitions.Item("AppUpdateMassPropertiesCmd").Execute myVolume = iProperties.Volume ' or Mass MessageBox.Show("Volume before = " & myVolume, "iLogic") d1 = Parameter("d1") MessageBox.Show("d1 before = " & d1, "iLogic") Parameter("d1")=d1 * 1.10 ThisDoc.Document.Rebuild() d1 = Parameter("d1") MessageBox.Show("d1 after = " & d1, "iLogic") ThisApplication.CommandManager.ControlDefinitions.Item("AppUpdateMassPropertiesCmd").Execute myVolume = iProperties.Volume ' or Mass MessageBox.Show("Volume after = " & myVolume, "iLogic")
Inventor


22.1.2014
8793×
applies to: Inventor ·