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:Ā 

Add-in only shows on the first of multiple instances of Inventor.

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
LiamSmith2
351 Views, 3 Replies

Add-in only shows on the first of multiple instances of Inventor.

As the subject line says, when multiple instances of Inventor are open on the same machine, the addin will only show in the first one. I do not see any errors generated and tried many approaches. I tried to use the ribbon\tab\pannel\control 

created by the first instance. Or in every subsequent instance of Inventor to delete the existing ribbon\tab\pannel\control, and recreate them from scratch. Both approaches did not work.

Has anyone seen this?

3 REPLIES 3
Message 2 of 4

Hi,

 

So far I am unable to reproduce the issue, my custom addins are getting loaded fine in multiple instances of Inventor and ribbon items are present in each of them.

 

Without more context, it will be very hard to help you further. Please consider providing a minimal buildable sample of your addin source code and specify which version of Inventor/OS you are working with.

 

Thank you,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 4

Thank you, Philippe. I was able to find the root cause of this issue. Our addin now shows in all simulataneusly open instances of Inventor.

 

 

I changed how I create a reference to the currently running Inventor app: 

from: 
var oApp = (Application)Marshal.GetActiveObject("Inventor.Application");

to:
var m_InventorApp = addInSiteObject.Application;

Message 4 of 4

Yes, you should always retrieve the Inventor.Application object from the addinSite when running the code from an addin.

 

The GetActiveObject API does not support multiple instances of an application. It will always return the first instance.

 

I'm glad you could solve your issue.

 

Regards,

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