API Starts Inventor 2019 not 2021

API Starts Inventor 2019 not 2021

SteveLainson6531
Contributor Contributor
463 Views
4 Replies
Message 1 of 5

API Starts Inventor 2019 not 2021

SteveLainson6531
Contributor
Contributor

I have versions 2019 and 2021 installed on my PC and I have reference to the 2021 Interop DLL (C:\Program Files\Autodesk\Inventor 2021\Bin\Public Assemblies\Autodesk.Inventor.Interop.dll) in my standalone Visual Studio project (as per screengrab) but when the app starts its fires up Inventor 2019 not 2021. Do I need to regserv the 2021 DLL or something? I dont really want to uninstall 2019.

 

Any idea why?

0 Likes
Accepted solutions (1)
464 Views
4 Replies
Replies (4)
Message 2 of 5

Michael.Navara
Advisor
Advisor
0 Likes
Message 3 of 5

SteveLainson6531
Contributor
Contributor

Thanks, but will I have an .addin file as my app is a standalone VS project? 

0 Likes
Message 4 of 5

Michael.Navara
Advisor
Advisor
Accepted solution

I don't know what do you mean "standalone project". If it is an exe application, then it is important how you start Inventor application. If you use something like CreateObject("Inventor.Application"), then last run version is started.  

You can start Inventor as process from concrete executable. (For example: "C:\Program Files\Autodesk\Inventor 2021\Bin\Inventor.exe"). Then you can get running instance by Marshal.GetActiveObject("Inventor.Application")

0 Likes
Message 5 of 5

SteveLainson6531
Contributor
Contributor

@Michael.Navara 

Thanks, yes its a .EXE and I start up a background Inventor instance using the following:

Imports Inventor              

Dim inventorAppType As Type = System.Type.GetTypeFromProgID("Inventor.Application")
                oInv = System.Activator.CreateInstance(inventorAppType)
                oInv.Visible = False 'Show/Hide it

and I have my Visual Studio Referencing v25.0.0.0 of Autodesk.Inventor.Interop.dll but for some reason I can see in Task Manager its starting up Inventor 2019.

 

I'll try starting it you suggest, thanks for tip I hadn't realised that was an option.

 

 

 

0 Likes