How to get the combined space claim mass properties?

Options
M
M Member, Employee Posts: 230
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:

Best Answers

  • M
    M Member, Employee Posts: 230
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    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, Employee Posts: 133
    First Answer Name Dropper First Anniversary Ansys Employee
    edited May 3
    Options

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

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