CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
New CADforum look launched.
Over 1.081.000 registered users (EN+CZ). New 1D nesting and 3D nesting tools, updated Color converter. New AutoCAD 2025 commands and variables. Learn about twiGIS.
Place your Ad on CADforum.cz

CAD tip CAD tip # 8271:

Question

CAD 
 %  platform  category 
A
Autodesk Inventor assembly drawings often contains references to iProperties and physical properties of the model (parts). But the "mass" property may be not always updated and the printed drawing may contain inaccurate assembly mass information.

The following VBA macro ensures that printing is invoked after the mass properties are updated:

Sub PrintWithUpdateMass() 'Update mass in all referenced documents Dim drw As DrawingDocument Set drw = ThisApplication.ActiveDocument Dim doc As Document Dim mass As Double For Each doc In drw.AllReferencedDocuments mass = doc.ComponentDefinition.MassProperties.mass Next Call drw.Update 'Invoke print or other command Call ThisApplication.CommandManager.ControlDefinitions("AppFilePrintCmd").Execute End Sub

No error checking included for simplicity

You can assign this macro to a new "Print" icon on your ribbon - see the Tip 8267.

Inventor2012
100% *CAD
18.10.2011    16850×  
Prices - CAD eShop:
applies to: Inventor 2012 ·

See also:
Tip 14117:Recoloring of Inventor assembly parts - random, by material, by mass or other property (T4I)
Tip 13938:ModDXF - utility for bulk modification/display of internal DXF properties in DWG entities.
Tip 12881:How to attach multiple raster images to my DWG in one go?
Tip 12815:How to fill iProperties into Inventor files from Excel?
Tip 12627:How to override weight of an assembly component in Fusion 360?


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
  



Featuring:
Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info


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