There is no way in SW API to get a document's internal ID("IID"). SW doesn't make that data publicly available, apparentlybecause it would be too convenient for programmers who need thatinformation. Still, there is a way to divine some usefulinformation 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 needonly check the creation date. But, not justany creation date. There are many ways to check creationdate, and most will not work for this purpose. The creation date ofinterest is the one generated the instant a user clicked the final"OK" when creating a new file in SW.
What's the right way? UseDSOfile.dll. The property"SummaryProperties.DateCreated" records the moment SWbrought this file into being. It does not change when a SW file ismoved, renamed, or copied. It is the "mitochondrial DNA" datestamp, passed down intact through generations of saves, moves, andcopies.
What's the wrong way? Nearly any other creation date property ormethod. SW's custom property "SW-Created Date" can change due to aSave As operation. Windows API methods creation dates can changedepending on how and where a file is moved or copied.
How reliable is the DSOfile create date for determining if twofiles share an IID? The inverse of the probability that two filesof interest were created by two separate people at the exact samesecond. Good enough.SolidworksApi macros







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 needonly check the creation date. But, not justany creation date. There are many ways to check creationdate, and most will not work for this purpose. The creation date ofinterest is the one generated the instant a user clicked the final"OK" when creating a new file in SW.
What's the right way? UseDSOfile.dll. The property"SummaryProperties.DateCreated" records the moment SWbrought this file into being. It does not change when a SW file ismoved, renamed, or copied. It is the "mitochondrial DNA" datestamp, passed down intact through generations of saves, moves, andcopies.
What's the wrong way? Nearly any other creation date property ormethod. SW's custom property "SW-Created Date" can change due to aSave As operation. Windows API methods creation dates can changedepending on how and where a file is moved or copied.
How reliable is the DSOfile create date for determining if twofiles share an IID? The inverse of the probability that two filesof interest were created by two separate people at the exact samesecond. Good enough.SolidworksApi macros