General Commands > About General Commands > model.massProp()

model.massProp()
Compute mass properties and add mass contributions.
Syntax
model.massProp().create(<tag>,"MassProperties");
model.massProp(<tag>).selection();
model.massProp(<tag>).set(<pname>,<expr>);
 
model.massProp(<tag>).create(<mctag>, "MassContributions");
model.massProp(<tag>).feature(<mctag>).selection()
model.massProp(<tag>).feature(<mctag>).set(<pname>,<expr>);
Description
Creating Mass Properties and Providing Geometry Source Selections
model.massProp().create(<tag>,“MassProperties”) creates a mass properties object that computes variables for mass properties such as total mass and the center of mass.
model.massProp(<tag>).selection().set(...) defines a local selection that assigns the mass properties to geometric entities that act as sources. For a complete list of methods available under selection(), see model.selection().
Specifying Density and Mass Properties
You can specify the density to be taken from a physics. For example,
model.massProp(<tag>).set("densitySource", "fromSpecifiedPhysics")
model.massProp(<tag>).feature("mc1").set("physics", "solid");
takes the density from the Solid Mechanics interface solid.
You can also specify a user-defined density. For example, to specify the density to be 1107 kg/m3, use
model.massProp(<tag>).set("densitySource", "userDefined");
model.massProp(<tag>).set("expr","1107[kg/m^3]");
To create variables for the center of mass and to not create variables for the moment of inertia:
model.massProp(<tag>).set("createCenterOfMass","on");
model.massProp(<tag>).set("createMomentOfInertia","off");
Adding a Mass Contribution
You can add mass contributions from other parts of the geometry (an adjacent boundary, for example) by creating a mass contribution:
model.massProp(<tag>).create("mc1","MassContributions");
model.massProp(<tag>).feature("mc1").set("expr", "3");
For the mass contributions, you can specify source selections and define the density in the same way as for the mass properties.
Properties and Variables for massProp
The massProp feature accepts the following properties:
The created variables for different mass properties have the following default names:
mass1.mass and mass1.volume for the mass and volume, respectively.
mass1.CMX, and so on, for the coordinates of the center of mass.
mass1.IXY, and so on, for the components of the moment of inertia.
mass1.Ip1, and so on, for the moment of inertia principal values.
mass1.Ip1X, and so on, for the moment of inertia principal directions.