& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Autodesk Support
Jun 27, 2024
Products and versions covered
The following rule gets the mass of the model document in the view that was placed first. It stores this mass value to a custom iProperty called TotalWT. This TotalWT must be displayed in the drawing title block.
Use the following code:
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()
Was this information helpful?
The Assistant can help you find answers or contact an agent.
What level of support do you have?
Different subscription plans provide distinct categories of support. Find out the level of support for your plan.
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved