Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hi @torben_schroederXDK86.  I don't think I have ever created a whole automation solution for a situation like this, but I know that I have touched on this general subject on multiple occasions in the past.  If I remember correctly the following method was involved in that process.

 

DesignProjectManager.ResolveFile 

As you can see, that method is associated with the DesignProjectManager Inventor API object.  That object can be found directly under the Application object (ThisApplication).  I have not really use that method that much myself, because I always resolve files manually, using the user interface dialogs, so I can not offer much as far as working examples of using it, or more detailed explanations about how it works beyond what its help page offers.

 

Another method that may get involved is this one:

FileDescriptor.ReplaceReference 

As you can see, it is associate with the FileDescriptor Inventor API object.  And that FileDescriptor object can be obtained from 4 different possible routes, as you can see under its 'Accessed From' portion of its online help page.

 

But you should understand the difference between an Inventor.Document and an Inventor.File first.  The File is essentially only the data that has been written to a long term storage medium, like a hard drive, or USB drive.  The Document is essentially an organized group of data being held within Inventor's session memory.  The document can exist before or after a File exists for it, because we can create new documents that have not been 'saved' yet.  And when a Document does have a File associated with it, it may contain different data than what is in the File, because we may have made changes to the Document that have not yet been saved to that file.  There are several different derived types of Documents, and each of them has a ReadOnly Property named File, that is supposed to return an Inventor.File type object, if it exists.  That File object has the File.ReferencedFileDescriptors property, which will return a FileDescriptorsEnumerator object.  You may also notice that the File has a File.HasLoadedDocuments property, which tells us that it is possible for a single File to contain the required data for defining multiple Documents.  Good to keep in mind.  Pay no attention to the HasReferencingFiles property, or the ReferencingFiles properties, because they will only be able to contain anything when those other Files &/or documents are currently loaded into Inventor's session memory, other wise they can not be found by Inventor.  That's something that Vault can likely help with, if you have it.  Back to the FileDescriptorsEnumerator...as you iterate through that collection, you encounter individual FileDescriptor objects, like we mentioned earlier.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)