API PROBLEM - HOW TO GET MASS PROPERTIES
API PROBLEM - HOW TO GET MASS PROPERTIES
(OP)
Hi all!
I hope you can help me about a problem on programming solidworks.I'm sorry if my english is not clear: i'm italian.
I need to retrieve the "center of mass" from a partdoc or a subassembly in an assembly document.
Possibilities are two:
1 - Select a component or a subassembly in an assembly document and retrieve center of mass and the mass.
2 - Select more than one part or subassembly and get the "common center of mass" of the objects.
I tried to use examples on the API-help of SW and on the solidworks site's but at least i was able to get the center of mass on selection of one component.The data i have retrieved are similar to those who are retrieved from the solidworks toolsmassprops, but it can be ok!
The problem is the multiple selection:i get points that are totally wrong.
I hope you understand and that someone can help me to solve this problem.
Thank you!Bye
I hope you can help me about a problem on programming solidworks.I'm sorry if my english is not clear: i'm italian.
I need to retrieve the "center of mass" from a partdoc or a subassembly in an assembly document.
Possibilities are two:
1 - Select a component or a subassembly in an assembly document and retrieve center of mass and the mass.
2 - Select more than one part or subassembly and get the "common center of mass" of the objects.
I tried to use examples on the API-help of SW and on the solidworks site's but at least i was able to get the center of mass on selection of one component.The data i have retrieved are similar to those who are retrieved from the solidworks toolsmassprops, but it can be ok!
The problem is the multiple selection:i get points that are totally wrong.
I hope you understand and that someone can help me to solve this problem.
Thank you!Bye






RE: API PROBLEM - HOW TO GET MASS PROPERTIES
RE: API PROBLEM - HOW TO GET MASS PROPERTIES
RE: API PROBLEM - HOW TO GET MASS PROPERTIES
YCG= SUM(ycg(i)*mass(i))/SUM(mass(i)
ZCG= SUM(zcg(i)*mass(i))/SUM(mass(i)
But I'm getting the feeling that you're going in a hard way.
Regards