隐私 | Cookie 首选项 | 报告不合规情况 | 使用条款 | 法律 (英文) | © 2025 Autodesk, Inc. 保留所有权利 | 京ICP备19053430号-1 | 京公网安备 11010502047539号
Autodesk Support
2024年6月27日
涵盖的产品和版本
以下规则获取了先放置的视图中模型文档的质量。 它将此质量值存储到名为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()
此信息是否有用?
隐私 | Cookie 首选项 | 报告不合规情况 | 使用条款 | 法律 (英文) | © 2025 Autodesk, Inc. 保留所有权利 | 京ICP备19053430号-1 | 京公网安备 11010502047539号