In a multibody part document you can right-click an individual solid body and select properties. The information there includes mass properties from the single surface body. There does not seem to be any path to obtain the same via the api, is this correct?
Neil
Correct, MassProperties is only accessible at the PartComponentDefinition level, I don't see a direct way to retrieve that info for a specific solidbody.
Suggestions for workaround could involve:
- Suppressing all other bodies by suppressing the features generating them and compute MassProperties for the part. But it might not work in all cases.
- Creating a temp part, copying the relevant body in that new part and get MassProperties for that temp part.
I hope it helps,
Philippe.
______________________________________________________________
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
Hi Philippe,
Thanks, as I suspected. Can I put in a request to have this added to the api since it is available in the software.
Neil
I'd like to see this functionallity added to the API as well. Have there been any other workarounds since the last post? Thanks for the help!
-Thomas
Hi Thomas,
At the moment there is no further suggestions.
Regards,
Philippe.
Hi,
you can get the (solid) surfacebody volume directly via surfacebody.volume(tolerance). You can also calculate area of the surfacebody iterating and adding the area of all its Faces. Multiply part density and surfacebody volume and you also get mass.
But I can't figure out how to get centers of gravity of (solid) surfacebodies. Any idea?
Sašo Prijatelj
Same answer as previously, using MassProperties.CenterOfMass property:
MassProperties is only accessible at the PartComponentDefinition level, I don't see a direct way to retrieve that info for a specific solidbody. Suggestions for workaround could involve: - Suppressing all other bodies by suppressing the features generating them and compute MassProperties for the part. But it might not work in all cases. - Creating a temp part, copying the relevant body in that new part and get MassProperties for that temp part.
Philippe.