Tick Talk on EsoxRepublic.com


Comparing files’ internal ID’s

Posted in Internal ID by Administrator on the May 22nd, 2008

Originally posted on the SW website API forum, forums.solidworks.com
Compare file internal ID’s

There is no way in SW API to get a document’s internal ID (”IID”). SW doesn’t make that data publicly available, apparently because it would be too convenient for programmers who need that information. Still, there is a way to divine some useful information about a file’s internal ID.

SW recognizes two files as having the same IID if
1.) they were created at the exact same second
2.) they were created by the same installation of SW

Very difficult to ascertain #2, but #1 comes easy.

To answer the question, “Do these two files have the same internal ID?”, one need only check the creation date. But, not just any creation date. There are many ways to check creation date, and most will not work for this purpose. The creation date of interest is the one generated the instant a user clicked the final “OK” when creating a new file in SW. What’s the right way? Use DSOfile.dll. The property “SummaryProperties.DateCreated” records the moment SW brought this file into being. It does not change when a SW file is moved, renamed, or copied. It is the “mitochondrial DNA” date stamp, passed down intact through generations of saves, moves, and copies.

What’s the wrong way? Nearly any other creation date property or method. SW’s custom property “SW-Created Date” can change due to a Save As operation. Windows API methods creation dates can change depending on how and where a file is moved or copied.

How reliable is the DSOfile create date for determining if two files share an IID? The inverse of the probability that two files of interest were created by two separate people at the exact same second. Good enough.

Leave a Reply

You must be logged in to post a comment.