Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Surfacebody properties via api

6 REPLIES 6
Reply
Message 1 of 7
nmunro
685 Views, 6 Replies

Surfacebody properties via api

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

6 REPLIES 6
Message 2 of 7
philippe.leefsma
in reply to: nmunro

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

Message 3 of 7
nmunro
in reply to: philippe.leefsma

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

Message 4 of 7
tneff2
in reply to: nmunro

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

Message 5 of 7
philippe.leefsma
in reply to: tneff2

Hi Thomas,

 

At the moment there is no further suggestions.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 6 of 7
SašoPrijatelj
in reply to: nmunro

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.
Message 7 of 7

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report