Surfacebody properties via api

Surfacebody properties via api

nmunro
Collaborator Collaborator
932 Views
6 Replies
Message 1 of 7

Surfacebody properties via api

nmunro
Collaborator
Collaborator

In a multibody part document you can right-click an individual solid body and select properties. The information there includes mass properties from the single surface body. There does not seem to be any path to obtain the same via the api, is this correct?

 

Neil

 

        


https://c3mcad.com

0 Likes
933 Views
6 Replies
Replies (6)
Message 2 of 7

philippe.leefsma
Alumni
Alumni

Correct, MassProperties is only accessible at the PartComponentDefinition level, I don't see a direct way to retrieve that info for a specific solidbody.

 

Suggestions for workaround could involve:

 

- Suppressing all other bodies by suppressing the features generating them and compute MassProperties for the part. But it might not work in all cases.

 

- Creating a temp part, copying the relevant body in that new part and get MassProperties for that temp part.

 

I hope it helps,

Philippe.

 

______________________________________________________________

If my post answers your question, please click the "Accept as Solution"

button. This helps everyone find answers more quickly!

 



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 7

nmunro
Collaborator
Collaborator

Hi Philippe,

 

Thanks, as I suspected. Can I put in a request to have this added to the api since it is available in the software.

 

Neil

        


https://c3mcad.com

0 Likes
Message 4 of 7

Anonymous
Not applicable

I'd like to see this functionallity added to the API as well. Have there been any other workarounds since the last post? Thanks for the help!

 

-Thomas

0 Likes
Message 5 of 7

philippe.leefsma
Alumni
Alumni

Hi Thomas,

 

At the moment there is no further suggestions.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 6 of 7

SašoPrijatelj
Advocate
Advocate

Hi,

 

you can get the (solid) surfacebody volume directly via surfacebody.volume(tolerance). You can also calculate area of the surfacebody iterating and adding the area of all its Faces. Multiply part density and surfacebody volume and you also get mass.

 

But I can't figure out how to get centers of gravity of (solid) surfacebodies. Any idea?

 

 

Sašo Prijatelj

-----------------------------------------------------------------------
AutoDXF - automatic flat pattern creation and batch export to DXF for Inventor

Please use "Accept as Solution" & give "Kudos" if this response helped you.
0 Likes
Message 7 of 7

philippe.leefsma
Alumni
Alumni

Same answer as previously, using MassProperties.CenterOfMass property:

 

MassProperties is only accessible at the PartComponentDefinition level, I don't see a direct way to retrieve that info for a specific solidbody.
 
Suggestions for workaround could involve:
 
- Suppressing all other bodies by suppressing the features generating them and compute MassProperties for the part. But it might not work in all cases.

- Creating a temp part, copying the relevant body in that new part and get MassProperties for that temp part.

 

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes