COM API CocreateInstance is called to get inventor application. If two different Inventor versions( say 2012, 2013) are installed on the same machine. How can we the access the API of the specific version?
You need to use following workaround.
- Make sure that there is no Inventor.exe running. This can be done using Process.GetProcessesByName
- Start corresponding inventor.exe using Process class
- Use GetActiveObject to get Inventor.Application from process you started. You can use Inventor.SoftwareVersion to find out which version is currently running.
private void test()
bool noInvProcess = true;
foreach (Process p in
// kill the process
// possibly with a timeout
catch (Exception ex)
noInvProcess = false ;
// assume we want to start inventor 2013
Process.Start(@"C:\Program Files\Autodesk\Inventor 2013\Bin\Inventor.exe");
// wait a moment
// get the active inventor application
string progId = "Inventor.Application";
Inventor.Application m_inventorApp =
SoftwareVersion oInvVer = m_inventorApp.SoftwareVersion;
MessageBox.Show("current running inventor is : " + oInvVer.Major);