CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 1775 

CAD tip CAD tip # 9952:

Question CAD 
 %  platform  category 
Q - question

iLogic rule - check whether iProperties are overridden.

A - answer iProperties in Inventor documents allow to manually override values of Mass and Volume. These values are also used for the automatic iProperty "Density".

Overrides of true values can be useful in many cases (purchased parts, dummy parts in assemblies), but they can also be source of problems if you e.g. forget to update or replace the overridden value.

With the following simple macro you can quickly check if the iProperties "mass" and "volume" are manually overridden in the current document (IPT part):

oPartDoc = ThisApplication.ActiveDocument  
oMassProps = oPartDoc.ComponentDefinition.MassProperties  
uom = oPartDoc.ComponentDefinition.Document.UnitsOfMeasure  
voverridden = oMassProps.VolumeOverridden  
moverridden = oMassProps.MassOverridden  
voLunits = uom.GetStringFromType(uom.LengthUnits) & "^3"  
MsgBox ("MassOverridden=" & moverridden & vbTab & " [" & uom.GetStringFromValue(oMassProps.Mass,uom.MassUnits) & "]" &  
vbCrLf &  
"VolumeOverridden=" & voverridden & vbTab & " [" & uom.GetStringFromValue(oMassProps.Volume, volunits) & "]" , _  
MessageBoxIcon.Information, _  
"iProp Overrides")  


Output from the macro:

100% *  CAD 
13.8.2014    5523×  
applies to: Inventor ·

See also:
Tip 12451:How to fill a material or appearance name into part's iProperties?
Tip 12432:Parse/replace Inventor iProperties using regular expressions.
Tip 12024:How to create a custom iProperty or Parameter with iLogic?
Tip 11983:How to use iLogic code to fill username into iProperties?
Tip 10852:iLogic - how to get part material and path from a drawing?

Back   All CAD Tips All CAD tips&tricks

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   

Link your AutoCAD texts with Excel tables/sheets. Export. Change. Import.
Try DwgText 2020 More info

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