- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use C# and when I want to access SurfaceBody.MassProperties, I get the following error:
Error CS1061 'SurfaceBody' does not contain a definition for 'MassProperties' and no accessible extension method 'MassProperties' accepting a first argument of type 'SurfaceBody' could be found (are you missing a using directive or an assembly reference?)
Is it defined in an assembly reference the should be added to the project?
Website: https://perceptino.com
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
> Is SurfaceBody.MassProperties removed from Inventor 2024 API?
No, and it's documented in the link you posted: https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SurfaceBody_MassProperties
> Is it defined in an assembly reference the should be added to the project?
You should reference the Autodesk.Inventor.Interop.dll of Inventor 2024.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. Everything works for me. Here is a piece of code in C#:
PartDocument oDoc = m_InvApp.ActiveDocument as PartDocument;
PartComponentDefinition oDef = oDoc.ComponentDefinition;
MessageBox.Show(oDef.SurfaceBodies[1].MassProperties.Mass + " kg", "MassBody");
Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor
LinkedIn | My free Inventor Addin | My Repositories
Did you find this reply helpful ? If so please use the Accept as Solution/Like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thank you @CattabianiI and @Andrii_Humeniuk,
My project was facing the issue because it was linked to an outdated version (26) of Autodesk.Inventor.Interop.
Website: https://perceptino.com