How to get the combined space claim mass properties?

M
M Member, Employee Posts: 199
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
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:

Answers

  • M
    M Member, Employee Posts: 199
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    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