Mass Properties
Function Introduced:
In Creo Parametric 7.0.0.0 and later, the density parameter for any material is PTC_MASS_DENSITY. When you edit the density of a material, the value of this parameter is updated. The alternate mass property parameter for an assembly, part, or body is PRO_MP_ALT_DENSITY. The reported density parameter for an assembly, part, or body is PRO_MP_DENSITY. In the case of an assembly or a part with different materials, the value of this parameter is the average density.
The function
ProSolidMassPropertyGet() provides information about the distribution of mass in the part or assembly.
The function
ProSolidMassPropertyWrite() writes the mass properties of the specified solid or body referenced by the coordinate system selection in the specified format. The input arguments are as follows:
• solid_or_body—ProSelection handle to the solid or body.
• csys_sel—ProSelection handle for the coordinate system. If this value is NULL, the function uses the default coordinate system of the input solid.
|
Note:
|
You can select the coordinate system using the component path of component or subassembly whose mass properties are required.
|
• format—Format of the mass property file. This is specified using the enumerated data type ProMassPropertyFormat and the valid values are:
◦ PRO_MP_TXT—Text format. The default value is 0.
◦ PRO_MP_CSV—CSV format. The default value is 1.
◦ PRO_MP_XML—XML format. The default value is 2.
The function
ProSolidBodyMassPropertyGet() calculates the mass properties of a body in the specified coordinate system. The input parameter
body is the handle to a part or an assembly.
Both the functions provide the mass distribution information relative to the specified coordinate system datum csys_name. If the value of the parameter csys_name is NULL, the default coordinate system is used.
The functions
ProSolidMassPropertyGet() and
ProSolidBodyMassPropertyGet() return the information in the structure
ProMassProperty, declared in the header file
ProSolid.h.
The ProMassProperty structure contains the following fields (all doubles):
• volume—The volume.
• surface_area—The surface area.
• density—The density is not defined until a material with well-defined density is assigned.
• mass—The mass.
• center_of_gravity[3]—The center of gravity (COG).
• coor_sys_inertia[3][3]—The inertia matrix.
• coor_sys_inertia_tensor[3][3]—The inertia tensor.
• cg_inertia_tensor[3][3]—The inertia about the COG.
• principal_moments[3]—The principal moments of inertia (the eigenvalues of the COG inertia).
• principal_axes[3][3]—The principal axes (the eigenvectors of the COG inertia).
The function
ProSolidBodyDensityGet() determines the density of the material assigned to a body. The input parameters
body is the handle to the body.
|
Note:
|
If a material is already assigned to the part, the output of the function is the density of the material that is assigned to the body. The density is measured in the units of the model. The density of the body is always the density of the material assigned to the body.
|
The function
ProSolidMassPropertyWithDensityGet() calculates the mass properties of a part or an assembly in the specified coordinate system. This function does not impact the mass properties of a solid. The input arguments are as follows:
• solid—Handle to the part or assembly specified by the ProSolid object.
• csys_name—Name of the coordinate system. If this is Null, the function uses the default coordinate system.
• dens_use_flag—Value of the density flag specified using the enumerated data type ProMPDensUse and the valid values are as follows:
◦ PRO_MP_DENS_DEFAULT—Calculate the mass properties using the material density.
◦ PRO_MP_DENS_USE_ALWAYS—Calculate the mass properties using the specified density, even if material has a defined density.
◦ PRO_MP_DENS_USE_IF_MISSING—Calculate mass properties using specified density, even if material does not have a defined density.
• density—Density used while calculating mass properties depending on the value specified for the input argument dens_use_flag.
The function
ProAssemblySolidMassPropertyGet() calculates the mass properties of a solid that is referenced by the specified coordinate system selection. The input arguments follow:
• solid —The handle to top assembly or component/sub-assembly.
• csys_sel—Selection of coordinate system specified using the array of ProSelection object. If this is NULL, the function uses the default coordinate system of the specified solid.