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.
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.
CAD tip # 8271:
Question
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
*CAD
18.10.2011
16850×
applies to: Inventor 2012 ·