在Inventor中物理特性在零部件创建完成后,属性不更新,那么需要使用MassProperty的API来实现。

代码如下:
Sub updateMassProperties()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
'后台调用MassProperty
Debug.print(oDoc.ComponentDefinition.MassProperties)
End Sub
或者
Sub updateMassProperties()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oMP As MassProperties
Set oMP = oDoc.ComponentDefinition.MassProperties
End Sub
解释说明:只要属性MassProperties被调用,那么就会自动更新。