I guess I'm a bit dense today since it's Monday. Can anyone
point me to how I can go from a ComponentOccurence to the
ComponentDefinition so I can access things like WorkPoints as in
" ...ComponentDefinition.WorkPoints.Item(PointName)".
I tried several variations of Occurence.Definition but all seemed to fail.
I wanted to expand this macro to find and print out all the Workpoints
in each occurence with XYZ's in assembly space. I have code to do the
listing of XYZ's, etc, just can't seem to get there from here!
TIA,
Bob S.
"dolphan" wrote in message news:25806395.1080566587294.JavaMail.jive@jiveforum1.autodesk.com...
> Here is an example from Autodesk University:
>
> Public Sub AssemblyTraversal()
> ' Get the active document, assuming it's an assembly.
> Dim oAsmDoc As AssemblyDocument
> Set oAsmDoc = ThisApplication.ActiveDocument
>
> ' Begin the assembly traversal.
> Call TraverseAsm(oAsmDoc.ComponentDefinition.Occurrences, 1)
> End Sub
>
> ' The Level argument is used to control the amount of indent for the output.
> Private Sub TraverseAsm(oOccurrences As ComponentOccurrences, Level As Integer)
>
> ' Iterate through the current list of occurrences.
> Dim oOcc As ComponentOccurrence
>
> For Each oOcc In oOccurrences
>
> ' Print the name of the current occurence.
> Debug.Print Space(Level * 3) & oOcc.Name
>
> ' If the current occurrence is a subassembly then call this sub
> ' again passing in the collection for the current occurrence.
> If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Then
> Call TraverseAsm(oOcc.SubOccurrences, Level + 1)
> End If
> Next
> End Sub
>
> // Johannes