Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting referenced Files from Assembly, without assembly load

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
413 Views, 2 Replies

Getting referenced Files from Assembly, without assembly load

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 ?

2 REPLIES 2
Message 2 of 3
YuhanZhang
in reply to: Anonymous

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.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks! It works!

 

And the second way,  try to handling FileAccessEvents.OnFileResolution(...)

It's good event 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report