How can I check the version of an Eyeshot file?

Since the Eyeshot proprietary file format can't read newer versions, it could be helpful to check the file version before proceeding to read it.

With Eyeshot 2023 you can check it with the below code.

int version = ReadFile.GetVersion(fileName);
if (version > devDept.Serialization.Serializer.LastVersion)
    Console.WriteLine("Unsupported Eyeshot file version.");
else
    Console.WriteLine($"Eyeshot file version is {version}.");

For the earlier versions of Eyeshot, you can use this code instead.

var header = ReadFile.GetHeader(fileName);
if (header == null)
   Console.WriteLine("Unsupported Eyeshot file version.");
else
Console.WriteLine($"Eyeshot file version is {header.Version}.");
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section

See more