Hide Table of Contents
GetMassProperties2 Method (IModelDocExtension)

Gets the actual mass properties of the components in the model at the specified accuracy.

.NET Syntax

Visual Basic (Declaration) 
Function GetMassProperties2( _
   ByVal Accuracy As System.Integer, _
   ByRef Status As System.Integer, _
   ByVal UseSelected As System.Boolean _
) As System.Object
Visual Basic (Usage) 
Dim instance As IModelDocExtension
Dim Accuracy As System.Integer
Dim Status As System.Integer
Dim UseSelected As System.Boolean
Dim value As System.Object
 
value = instance.GetMassProperties2(Accuracy, Status, UseSelected)
C# 
System.object GetMassProperties2( 
   System.int Accuracy,
   out System.int Status,
   System.bool UseSelected
)
C++/CLI 
System.Object^ GetMassProperties2( 
&   System.int Accuracy,
&   [Out] System.int Status,
&   System.bool UseSelected
) 

Parameters

Accuracy
  • 0 = as is

  • 1 = default

  • 2 = maximum

Status
Error code as defined in swMassPropertiesStatus_e
UseSelected
True to return the mass properties of the selected components only, false to return the mass properties of the entire model, excluding suppressed components

Return Value

Array of size 12 (see Remarks)

Example

Remarks

If this model is...

Then pre-select...

An assembly

Components for which to get mass properties. This method returns the center of mass and moments of inertia in the coordinate system of the assembly.

A part

Solid bodies for which to get mass properties. The calculated origin for the returned values is based on the default coordinate system of the part. It is not based on the selected coordinate system.

The return value is a 0-based array of doubles as follows:

[ CenterOfMassX, CenterOfMassY, CenterOfMassZ, Volume, SurfaceArea, Mass, MomXX, MomYY, MomZZ, MomXY, MomZX, MomYZ ]

Where:

  • MomNN = NN-component of the moment of inertia taken at the center of mass and aligned with the output coordinate system 

You can use ISldWorks::GetUserPreferenceDoubleValue and swMaterialPropertyDensity to get the density of the SOLIDWORKS part. If the user did not explicitly set the density, then SOLIDWORKS uses a value of 1.0. You can also derive the density of the body by calculating:

Density = ( Mass / Volume )

This method:

  • returns values in metric units.
  • supports multibody parts.
 

See Also

Availability

SOLIDWORKS 2016 FCS, Revision Number 24.0


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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   GetMassProperties2 Method (IModelDocExtension)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

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.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2019 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.