Using Apprentice rather than Inventor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got a VBA macro in Inventor that includes iterating through all documents reference by an assembly, and appears to work well. The relevant bit of code is
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator
Set oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document
For Each oRefDoc In oRefDocs
........
Next
I'm trying to do the same thing with Apprentice via VB6 using this code
Dim oApprentice As New ApprenticeServerComponent
Dim assyDoc As ApprenticeServerDocument
Set assyDoc = oApprentice.Open(fname)
Dim oRefFile As ApprenticeServerDocument
For Each oRefFile In assyDoc.ReferencedDocuments
......
Next
It partially works, but whereas the IV code lists documents below a referenced assembly, the Apprentice code doesn't.
Clearly the Apprentice code is wrong.
Guidance would be appreciated.