AnsweredAssumed Answered

How to extract the coordinates of the Center of Mass?

Question asked by Diego Saenz on May 3, 2018
Latest reply on May 3, 2018 by Amen Allah Jlili

I need to extract the coordinates of the Center of Mass of my part, so I can use them for further calculations.I'm new to SolidWorks API and I have no idea on how to do this, all I have been able to find is this code to show the COM:

Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim COM As SldWorks.Feature
Dim COMRP As SldWorks.Feature

Option Explicit

 

Sub main()

    Set swApp = Application.SldWorks
    Set Part = swApp.ActiveDoc

    Set COM = Part.FeatureManager.InsertCenterOfMass
    Set COMRP = Part.FeatureManager.InsertCenterOfMassReferencePoint
  

End Sub

Can some one help me?


Outcomes