Error in 2018 Autodesk.Inventor.Interop when trying to get the ScreenQuadrant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to get the different values for the new 3D annotations in Inventor 2018 parts using the Inventor 2018 API, and this mostly goes OK.
I have found one error in the Autodesk.Inventor.Interop where there is a property with an incorrect type definition.
On the ModelGeneralNoteDefinition object there is a property called ScreenQuadrant which according to the API help should be of a ScreenQuadrantEnum type.
This is also the type I get when accessing the property from a VBA macro
When I try the same from a VB.NET program where I have referenced the Autodesk.Inventor.Interop dll in version 22.0.0.0 for Inventor 2018, the object browser in Visual Studio shows this property as an IntPtr, which is clearly wrong, and I get an illegal type cast exception if I try to get the property directly.
If I do a QuickWatch in Visual Studio on an instance of a ModelGeneralNoteDefinition I can find the correct type and value under the dynamic properties for the COM object.
To get the value of the ScreenQuadrant property in VB.NET I have to use Option Strict Off and dynamic dispatch to get the actual type and the correct enum value, in C# this could be done with a Dynamic declaration and dynamic dispatch.
It would be easier, and more type safe, if the property type was fixed in the Autodesk.Inventor.Interop definition.
There is also some errors in the Inventor 2018 API help for this property, when you try to click through to get to the actual enumeration definition for ScreenQuadrantEnum, you get a page not found error and the ScreenQuadrantEnum is not in the list of enumerations in the content tree
Regards,
Jens Bejer Pedersen
Developer
