The IMassProperty object:
allows applications to directly access individual mass properties as found on the Mass Properties dialog box.
obtains mass property information about one or more solid bodies in the document from which the IMassProperty object is obtained.
Only use solid bodies for mass property calculations. You can specify the coordinate system about which the moments is calculated using IMassProperty::SetCoordinateSystem. If you do not use IMassProperty::SetCoordinateSystem, then the document’s origin is the coordinate system. By default, system units (meters, radians, and grams) are used. All properties returning a value are adjusted accordingly. See IMassProperty::UseSystemUnits for more information.
The results of the mass property calculations vary based on whether or not IMassProperty::AddBodies or IMassProperty::IAddBodies is used.
If IMassProperty::AddBodies or IMassProperty::IAddBodies is...
Then...
Called and bodies are specified
These bodies can either be from a subset of the document’s body list or from temporary bodies.
NOTE: Each specified body should either come from the owning document or be a temporary body. If the body does not satisfy either case, then it is not used when calculating the mass properties.
Not called
Mass properties' calculations include all available bodies in the document.
Part. All of the solid bodies are included in the calculations.
Assembly. All of the bodies in all of the components are used in the calculations.
If the document from which the IMassProperty object came is an assembly, then any body from any of the child components can be used. When obtaining the body, a call to IComponent2::GetBodies2 is needed. Your application does not need to make a copy of the body or apply a transform to the body.
Provide feedback on this topic
SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.
* Required
Thank you for your comments. We will contact you if we have questions regarding your feedback.
Sincerely,The SOLIDWORKS Documentation Team
Print Topic
Select the scope of content to print:
We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.
Web Help Content Version: API Help (English only) 2012 SP05 To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help. To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.