Model.hm_getmass#

Model.hm_getmass(collection, mass_type=1)#

Returns the mass, volume and area of the selected elements or components.

Parameters:
  • collection (Collection) – The collection containing the entities to consider. Valid entities are elements, components, materials, properties, parts, assemblies, plies, and laminates.

  • mass_type (int) –

    The type of mass to output. Valid options are:

    0 - All mass values

    1 - Total mass, total volume, and total area

    2 - Structural mass

    3 - Non-structural mass

    4 - Rigid mass

    5 - Lumped mass

    6 - Transferred mass

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • Keys valid for matt_type=0

      • totalmass (double)

      • totalarea (double)

      • totalvolume (double)

      • totalstructuralmass (double)

      • totalnonstructuralmass (double)

      • totalrigidmass (double)

      • totalLumpedMass (double)

      • totalTransferredMass (double)

      • solverpartmass (double)

      • totalmodelmass (double)

    • Keys valid for matt_type=1

      • totalmass (double)

      • totalarea (double)

      • totalvolume (double)

    • Keys valid for matt_type=2

      • totalstructuralmass (double)

    • Keys valid for matt_type=3

      • totalnonstructuralmass (double)

    • Keys valid for matt_type=4

      • totalrigidmass (double)

    • Keys valid for matt_type=5

      • totalLumpedMass (double)

    • Keys valid for matt_type=6

      • totalTransferredMass (double)

Example#

Get the mass for elements with IDs 1 - 100#
import hm
import hm.entities as ent

model = hm.Model()

elem_collection = hm.Collection(model, ent.Element, list(range(1, 101)))

_, result = model.hm_getmass(collection=elem_collection)

mass = result.totalmass
area = result.totalarea
vol = result.totalvolume