By Adam Nagy
AnyCAD functionality enables you to include non-native file formats directly in your assembly.
For those files the FullDocumentName/FullFileName will be special because Inventor has proxy documents for those components:
FullDocumentName:**C:\Temp\AnyCAD\Workspaces\Workspace\AnyCADBase.iam*LocalDocs*xFu0c05ic1y3mu2kv3oevwllrOa*1000083398swa000.iam FullFileName:**C:\Temp\AnyCAD\Workspaces\Workspace\AnyCADBase.iam*LocalDocs*xFu0c05ic1y3mu2kv3oevwllrOa*1000083398swa000.iam --------------------------- FullDocumentName:**C:\Temp\AnyCAD\Workspaces\Workspace\AnyCADBase.iam*LocalDocs*xS5rzpyzj10cluts2Febybwr1Bg*1000082731swp000.ipt FullFileName:**C:\Temp\AnyCAD\Workspaces\Workspace\AnyCADBase.iam*LocalDocs*xS5rzpyzj10cluts2Febybwr1Bg*1000082731swp000.ipt
If you need to find the original file which is being referenced then you need to look for it in the ImportedComponents collection:
Sub CheckAnyCADInAssembly() Dim doc As AssemblyDocument Set doc = ThisApplication.ActiveDocument Dim oImportComponent As ImportedComponent For Each oImportComponent In doc.ComponentDefinition.ImportedComponents If oImportComponent.LinkedToFile Then Debug.Print oImportComponent.Definition.FullFileName End If Next End Sub
Output:
C:\Temp\AnyCAD\Workspaces\Workspace\1000083398swa000.sldasm
Although you can list all the non-native files that got imported (see below code), you can only find a direct connection between the top assembly that got imported and the original assembly it is referencing. There is no direct connection exposed in Inventor 2016 between the sub components / occurrences and the original part and assembly files that got imported:
Sub CheckAnyCADInAssembly() Dim doc As AssemblyDocument Set doc = ThisApplication.ActiveDocument Dim oDoc As File For Each oDoc In doc.File.AllReferencedFiles Debug.Print oDoc.FullFileName Next End Sub
Sample output:
C:\Gears_&\frame_&.SLDPRT C:\Gears_&\gears_&.SLDASM C:\Gears_&\Internal Spur Gear_&.sldprt C:\Gears_&\shaft1_&.SLDPRT C:\Gears_&\shaft2_&.SLDPRT C:\Gears_&\Spur Gear_&.sldprt