How do I extract the CoG coordinates from each part in an assembly?

Hello 

I need to extract the coordinates of the CoGs of each part (or several parts) present in an assembly, IN THE COORDINATE SYSTEM OF THE ASSEMBLY.

By assigning the Xcog, Ycog and Zcog personal properties to each room, we can then easily retrieve these coordinates, but they are obviously in the part coordinate system...  

Do you have a solution for these coordinates to be expressed in the general reference of my assembly please?

The question will also arise for inertia .......  

 

Thank you in advance for your help!

Fabian.

 

See this topic:

https://www.codestack.net/solidworks-api/document/assembly/components/export-positions/

Or this one:

https://www.codestack.net/solidworks-api/document/assembly/components/get-cog/

Or this one:

https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/#community:yUw32GbYTEqKdgY7-jbZPg/iquestion:hUKmfQGeSMmfYDJPg4gdIg

 

Not tested, but with a little luck you will find your pleasure! Especially the 1st in general on this site it works well.

3 Likes