CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 3554 

CAD tip CAD tip # 9659:

Question CAD 
 %  platform  category 
Q - question

iLogic: adjusting model parameters to match model volume or mass

A - answer 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
100% *  CAD 
22.1.2014    2755x  
Comments   Tell a friend
applies to: Inventor ·

See also:
Tip 11211:Mass change of units in the whole Inventor assembly.
Tip 11111:Inventor drawing diplays flipped, mirrored (as from underside)
Tip 10889:How to get user's full domain name, phone No., department, e-mail...
Tip 10852:iLogic - how to get part material and path from a drawing?
Tip 10426:How to display any web page in Inventor?


Back   All CAD Tips All CAD tips&tricks

Where to find the Portable license utility (PLU) in AutoCAD 2010, 2012, 2014 and higher? « | » Inventor: Cannot load library MbUI.dll and RxPart.dll.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Use Google Earth images in your AutoCAD projects with the Plex.Earth Tools More info


Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist