CAD FORUM - TIPS & TRICKS | UTILITIES | DISCUSSION | BLOCKS | SUPPORT | HELP & ASSISTANCE
Over 1.129.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 # 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
9470×
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?