How to get the combined space claim mass properties?

M
M Member, Employee Posts: 244
50 Answers 100 Comments 100 Likes Second Anniversary
✭✭✭✭
edited June 2023 in Structures

V2021R2

A customer recently requested the mass properties of selected bodies in SpaceClaim. Does anyone know a direct way to get this data?

Tagged:

Best Answers

  • M
    M Member, Employee Posts: 244
    50 Answers 100 Comments 100 Likes Second Anniversary
    ✭✭✭✭
    Answer ✓

    meister Mladenov to the rescue:

    selection = BodySelection.Create(GetRootPart().Bodies)
    massProps = MeasureHelper.GetMassProperties(selection)
    mass = massProps.Mass
    
    pax = massProps.PrincipleAxes.AxisX
    pay = massProps.PrincipleAxes.AxisY
    paz = massProps.PrincipleAxes.AxisZ
    
    principalMomentXAxis = massProps.GetMoment(pax)
    principalMomentYAxis = massProps.GetMoment(pay)
    principalMomentZAxis = massProps.GetMoment(paz)
    
    paxD = pax.Direction
    payD = pay.Direction
    pazD = paz.Direction
    

Answers

  • Erik Kostson
    Erik Kostson Member, Moderator, Employee Posts: 276
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited May 3

    to add, in order to get the centre of volume:

     mp=body.MassProperties.RawSubject
     cen=mp.Center