如何在Inventor文件中将磅质量单位切换为磅

Autodesk Support

2024年6月27日


涵盖的产品和版本


问题:

在工程图模板标题栏的估算重量部分中,质量具有lbmass单位,而不是Inventor中的lb
 

解决方案:

以下规则获取了先放置的视图中模型文档的质量。 它将此质量值存储到名为TotalWT的自定义iProperty。  此TotalWT必须显示在图形标题栏中。
使用以下代码:

doc = ThisDoc.Document
customPropertySet = doc.PropertySets.Item("Inventor User Defined Properties")
 
'Make sure TotalWT property exists
Try
      prop = customPropertySet.Item("TotalWT")
Catch
      'Assume error means not found
      customPropertySet.Add("", "TotalWT")
End Try


'Find the filename of the model used in the drawing
modeldocname = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName)

'Find the mass of the model used in the drawing
mass = iProperties.Mass(modeldocname)

'Write the mass of the model to the TotalWT custom iProperty.
'The mass is converted from kg to lbs and rounded to the nearest integer
iProperties.Value("Custom", "TotalWT") = Round(mass*2.20462)

InventorVb.DocumentUpdate()

 

产品:

Inventor Series、Inventor Professional、Inventor LT、Inventor Factory、Inventor;

版本:

2017; 2018; 2019; 2016;


此信息是否有用?


需要帮助?请求助 Autodesk 助手!

助手可以帮助您找到答案或联系支持人员。


您享有什么级别的支持?

不同的固定期限使用许可方案提供了不同级别的支持。了解您的许可方案提供的支持级别。

查看支持级别