How to switch lbmass unit to lb in an Inventor file

Autodesk Support

Jun 27, 2024


Products and versions covered


Issue:

In a drawing template title block's section for estimated weight, the mass has a lbmass unit rather than lb in Inventor.
 

Solution:

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()

 

Products:

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

Versions:

2017; 2016; 2019; 2018;


Was this information helpful?


Need help? Ask the Autodesk Assistant!

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.

View levels of support