Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: Anonymous

OK, new idea.

 

Use this ilogic code to create a user parameter called mass and fill that parameter with the mass of the part.

 

SyntaxEditor Code Snippet

Try

    Parameter("Mass")=iProperties.Mass
    
    Catch
    
    oMyParameter=ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters
    
    oParameter=oMyParameter.AddByExpression("Mass", "5", "kg")
    'oParameter=oMyParameter.AddByValue("Mass", "", UnitsTypeEnum.kKilogramMassUnits)
    
    Parameter("Mass")=iProperties.Mass
    
End Try

 

 

Then in document settings change the base quantity to the new parameter and bingo!

 

mass.PNG

 

yessss.PNG

 

You can set the rule to run every time you save so the mass always gets updated