Solved! Go to Solution.
Solved by Lesoux. Go to Solution.
I know two ways for that.
1. In the factory file you need to create iLogic rule as Weight, for example and write this code:
weight = iProperty.Mass
Add trigger on this rule to update rule when something changed. You need to be sure that "weight" variable has been created in parameters.
Adopt factory file and select your weight variable as read-only. After that you can call this variable in Intent anytime and anywhere.
2. Using API. You can either create method or function.
Method weight(target As Part) As Number
Dim obj As Any = GetHostObject(target)
Dim compDef As Any = obj.Definition
Dim massProps As Any = compDef.MassProperties
massProps.Accuracy = k_VeryHigh ' k_High, k_Low, k_Medium, k_None, k_VeryHigh
Return massProps.Mass
End Method
Try to play.
Lol.
You wanted set a mass to the part. I shown you how to get mass from the part. Definitely, all my minds is mixed in my head.
Can't find what you're looking for? Ask the community or share your knowledge.