How to access Center of Mass in SpaceClaim/Discovery?
Andrew Stankovich
Member, Employee Posts: 10
✭✭✭
How can you access the center of mass of body inside Discovery or SpaceClaim?
Tagged:
0
Answers
-
The center of mass is stored in the MassProperties of a body and can be accessed via the PricipleAxes.Origin.
Also, there is a MeasureHelper function to directly get the center of mass from a selection. This can be helpful if you need the combined center of mass of multiple bodies.
Code Example:
bodies= GetRootPart().GetAllBodies() for body in bodies: print body.MassProperties.PrincipleAxes.Origin print MeasureHelper.GetCenterOfMass(Selection.Create(body))
0