Best Practices: Autodesk Inventor
Autodesk Inventor is a 3D mechanical CAD software program for crating 3D digital prototypes used in the design, visualization and simulation of products. Autodesk Inventor does not maintain a handle on opened files and allows multiple users the ability to open and edit the same file. Inventor relies on a file named lockfile.lck to prevent users from saving changes which may overwrite the work of other users. The lock file stores user and status information of Inventor files opened and modified within the same directory.
Lock file
A single Inventor lock file (lockfile.lck) exists per directory to manage all Inventor files within that directory. It gets created when a user opens an Inventor file and will remain there until the user closes Inventor. As more users open files from that directory through Inventor, the lock file gets updated to keep track of those files. Inventor maintains a handle on the lock file while at the same time allowing Read + Write access to it. This is to ensure that Inventor can continue to make updates to the file as users open, close, and modify files. These files are partially locked and are similar to Exchange and SharePoint managed files.
Peer interaction
In order for us to be able to collaborate on Inventor files, we must be able to synchronize the lock file as soon as it changes in order for Inventor to be able to protect files from being overwritten in all locations. Both Peer Global File Service and PeerSync have ways to achieve this to some degree, but the solutions they provide are incomplete:
- Peer Global File Service, for example, needs to use the Sync on Save option, but has no option currently to exclude the lock file form being locked—if Peer Global File Service locks the lockfile.lck file, it will prevent Inventor from writing to it on the source/target to prevent version conflicts.
- PeerLock is able to exclude the lock file from being locked, but PeerSync requires the use of VSS on an aggressive cycle to gain access to the source file while it is in use.
Note: Additional PeerSync options that may be needed:
/Q7R (to get a very light handle on the source file)
/GYV05 (to get a more frequent VSS frequency)
/QD (for VSS to include only the extensions we are interested in)
/YF:.lck (identify the lock file in the VSS extension list) - More importantly, both products will fail to synchronize the lock file if it is locked by Inventor on the target. This means if anyone opens ANY Inventor file in the same directory as the target file, Inventor will fail to write that information to the lockfile.lck. Thus, PeerSync and Peer Global File Service will fail to update the lock file if anyone has an Inventor file open in the target folder.
- In order for us to be able to update the partially locked lockfile.lck file, we would need to learn more about how Inventor writes to the lock file. This would involve some reverse engineering of the file to figure out what blocks are locked and where do new records get written to (at the end?). We could then customize our sync logic to be compatible.
Summary
Both Peer Global File Service and PeerSync support the synchronization of Inventor files as long as the lockfile.lck file is excluded from being locked. Therefore, Peer only supports Inventor files in scenarios where these files are accessed by users in one location only. This requires adding the lockfile.lck file to the list of SyncOnly filters in Peer Global File Service and excluding them from PeerLock (but not PeerSync).
Peer will fail to synchronize the lockfile.lck file if it is locked by Inventor on the target. This means that if anyone opens ANY Inventor file(s) in the same directory as the target file, Peer Global File Service and PeerSync will fail to sync the lock file.