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

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  
'InventorVb.DocumentUpdate()  
  
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")  
 


Example:

Output from the macro:

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

See also:
Tip 12644:How to identify parts and assemblies imported from STEP/IGES?
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?


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   



Featuring:
Simply link AutoCAD LT blocks to Excel table data.
Excellink LT 2006 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.
TOPlist