Determine Inventor file version

Determine Inventor file version

Raider_71
Collaborator Collaborator
1,766 Views
4 Replies
Message 1 of 5

Determine Inventor file version

Raider_71
Collaborator
Collaborator

Hi guys,

 

What would be the easiest way to check an Inventor file version to make sure that the open/openwithoptions methods dont crash if the file version is newer than the current Inventor being used to run the application through.

I run multiple versions of Inventor on my PC and as such have multiple Inventor file versions on my PC. If I try and access/open a file with one of my apps using either the full API or Apprentice, it crashes the app at that point if the file version is newer than what the current Inventor version can handle. I would like to catch this before it gets there.

 

Hope it makes sense and that someone can help.

 

Cheers

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

philippe.leefsma
Alumni
Alumni
Accepted solution

Application.FileManager.SoftwareVersionSaved will get the job done without opening the file.

 

It's only available from Inventor, I don't think there is a way through an Apprentice App.

 

Hope it helps,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

Raider_71
Collaborator
Collaborator

Ahhhhhh thats what I was looking for! Thanks a lot!

0 Likes
Message 4 of 5

Raider_71
Collaborator
Collaborator

Hi philippe,

 

I have started implementing this in one of my applications. So for testing purposes I have three versions of Inventor installed on my PC. This is the code I use:

 

Dim oFileMan As Inventor.FileManager
oFileMan = oApp.FileManager
Dim intFileversion As Integer

For Each Filename In OpenFileDialog1.FileNames
intFileversion = FileMan.SoftwareVersionSaved(Filename).Major

...

The above works fine with Inventor 2014 running but crashes Inventor 2013 completely on the last line of code when the file version is actually higher than 2013.

 

Any ideas?

0 Likes
Message 5 of 5

Raider_71
Collaborator
Collaborator

Hi philippe,

 

Ok I have loaded Inventor 2013 SP2 plus Update 4 for SP2 and now the problem is gone.

 

I had SP 1.1 loaded before.

 

Thanks

 

Cheers

0 Likes