API fails under Inventor 2016 and Visual Studio 2010. Help!

API fails under Inventor 2016 and Visual Studio 2010. Help!

liminma8458
Collaborator Collaborator
956 Views
2 Replies
Message 1 of 3

API fails under Inventor 2016 and Visual Studio 2010. Help!

liminma8458
Collaborator
Collaborator

Hi,  any who can help:

 

We are going to move onto Inventor 2016 from Inventor 2013. Before doing that, we have to ensure our addin work. I test some basic code on our platform: window 7 64 bit pro, Inventor 2016 pro, Visual studio 2010 pro.

 

I use InventorAddinTemplate of 2016 in the VS 2010 (VB.NET) and set up to create a DLL addin, using exact code as the template. Then I test run the code (in debug mode). The fundamental object "g_inventorApplication" fails to return most of values for its properties. As shown on attached screen shots in the Word file, any property from "ActiveAppearanceLibrary" to the end will reture "Unable to evaluate expression", including many basic properties such as "ActiveView", "Documents", etc.  So my code followed will fail too!

 

I wonder whether it is duo to the .NET framework. Inventor 2016 utilizes .NET framework 4.5. But VS2010 only can target to framework 4. However, the compiled file from VS2010 should work in a 4.5 enviroment, because .NET framework is backward compatible. Correct me if I am wrong.

 

Also attached is the source code. 

 

So, what happen? please help.

 

Thank you very much!

 

Limin

 

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Accepted solutions (1)
957 Views
2 Replies
Replies (2)
Message 2 of 3

Balaji_Ram
Alumni
Alumni

Hi Limin,

 

Sorry for the delay.

 

I do not see any issue in using Visual Studio 2010 to create an addin with .Net framework set as 4.0 to work with Inventor 2016.

 

The sample project that you attached did work ok in Inventor 2016 and I have attached the watch window.

 

Have you tried it on any other system with a similar setup ?  

 

Regards,

Balaji

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

liminma8458
Collaborator
Collaborator
Accepted solution

Balaji,

 

Finally, I may find the answer, but quite subtle one. My inventor addin is moved from Inventor 2013 to Inventor 2016. But I also have some VBA code in my Inventor 2013, which is also called from the addin. Some code VBA is not compatible with Inventor 2016.

 

When I make the VBA code compatible with Inventor 2016.  The run time problem is gone for the VB.NET addin. I don't know why, but I accept as it is. Of course, further comment will be welcome.

 

Thanks

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes