CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 17593

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    11433×  
Prices - CAD eShop:
applies to: Inventor ·

See also:
Tip 13884:How to send e-mails with an iLogic macro?
Tip 13611:BOM with multi-line items in Inventor.
Tip 13536:iLogic: How to find if a document is a sheet metal part and if it contains holes?
Tip 13211:Automatic numbering/renaming of multi-volume bodies in a part.
Tip 13197:How to transfer a model or sketch parameter to iProperties?


Back   All CAD Tips



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:
Increase your productivity with our set of BIM add-on functions for Autodesk Revit
CADstudio Revit Tools More info


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