I recently had a customer request a bit more from the code that I posted on a past blog.
In that post I used iLogic to populate a user parameter with the models mass.
iProperties.Value("Custom","Mass") = Round(iProperties.Mass, 2)
Here I am taking that code to the next level and populating a Custom iProperty with lbs and kg.
Create a rule with this code and then assign the event trigger “Part Geometry Change” to the rule.
Round_Mass_lbs = Round(iProperties.Mass, 2)
Round_Mass_kg = Round(iProperties.Mass * 0.45359237, 2)
iProperties.Value("Custom", "Mass") = Round_Mass_lbs & " lbs " & "(" & Round_Mass_kg & " kg)"
And finally here is a example of the results.