How to know, what files (of parts) included to assembly. Without assembly load ?
For example: I keep my assemblies in DataBase. And i need to know what files should checkout in hard disk, with asm file. This problem resolved in SolidWorks by two ways.
1. There is special method, which return dependency files for assembly file.
GetDocumentDependencies([in] DocumentFilePath, [out] ArrayOfDependFiles )
2. Silent load assembly (loading without UI errors). Getting referenced Files. And reload...
How to resolve my problem in Inventor ?
You can try with loading the document silently in Inventor:
Sub FindReferencedFilesInAssy() ThisApplication.SilentOperation = True Dim oDoc As AssemblyDocument ' Open assembly in hidden mode Set oDoc = ThisApplication.Documents.Open("C:\Temp\MyAssy.iam", False) Dim oRefFile As FileDescriptor For Each oRefFile In oDoc.file.ReferencedFileDescriptors Debug.Print oRefFile.FullFileName Next ThisApplication.SilentOperation = False End Sub
Also you can use Apprentice to do this. Please let me if I can help more.
Thanks! It works!
And the second way, try to handling FileAccessEvents.OnFileResolution(...)
It's good event 🙂