Message 1 of 8
ReferencedFileDescriptors

Not applicable
06-14-2006
01:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey All,
I'm trying to get a list of all files associated with an IDW or and IAM.
Basically what I want to do is select a drawing file and get a list of all files that are in that reference and stuff the results into a list.
The code I have only works a little bit.
If my drawing references an assembly and that assembly has two components the result I get is the assembly idw, the assembly iam and one of the two parts in the assembly. And then it exits out of the sub.
I'm not sure I'm even going about this the correct way.
I want it to work like Design Assistant where you can pick the top level of an IDW and get all teh children.
Lots of thanks in advance for any assistance you can provide.
AllenG
Private Sub FileRef(FileName As String)
Dim oApprentice As ApprenticeServerComponent
Dim oDoc As ApprenticeServerDocument
Dim ReferencedFileDescriptor As ApprenticeServerComponent
Dim oRefFileDesc As ReferencedFileDescriptor
Set oApprentice = New ApprenticeServerComponent
Set oDoc = oApprentice.Open(FileName)
Set oRefFileDesc = oDoc.ReferencedFileDescriptors(1)
MsgBox oDoc.ReferencedFiles.Count
For Each oRefFileDesc In oDoc.ReferencedFileDescriptors
Form1.lstAvailableFiles.AddItem oRefFileDesc.FullFileName
Call FileRef(oRefFileDesc.FullFileName)
Next oRefFileDesc
Set oRefFileDesc = Nothing
Set oApprentice = Nothing
Set oDoc = Nothing
End Sub
I'm trying to get a list of all files associated with an IDW or and IAM.
Basically what I want to do is select a drawing file and get a list of all files that are in that reference and stuff the results into a list.
The code I have only works a little bit.
If my drawing references an assembly and that assembly has two components the result I get is the assembly idw, the assembly iam and one of the two parts in the assembly. And then it exits out of the sub.
I'm not sure I'm even going about this the correct way.
I want it to work like Design Assistant where you can pick the top level of an IDW and get all teh children.
Lots of thanks in advance for any assistance you can provide.
AllenG
Private Sub FileRef(FileName As String)
Dim oApprentice As ApprenticeServerComponent
Dim oDoc As ApprenticeServerDocument
Dim ReferencedFileDescriptor As ApprenticeServerComponent
Dim oRefFileDesc As ReferencedFileDescriptor
Set oApprentice = New ApprenticeServerComponent
Set oDoc = oApprentice.Open(FileName)
Set oRefFileDesc = oDoc.ReferencedFileDescriptors(1)
MsgBox oDoc.ReferencedFiles.Count
For Each oRefFileDesc In oDoc.ReferencedFileDescriptors
Form1.lstAvailableFiles.AddItem oRefFileDesc.FullFileName
Call FileRef(oRefFileDesc.FullFileName)
Next oRefFileDesc
Set oRefFileDesc = Nothing
Set oApprentice = Nothing
Set oDoc = Nothing
End Sub