
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to loop trough an assembly with multiple subassemblies and parts, and I can't manage to use the componentoccurence as an argument of the recursive function LoopAssembly (oPart)
I always get:
run-time error '438'
Object dosen't support this property or method
I have also tried this by looping trough each Bomrow of a BOM, and i had the same issue when passing the Bomrow as an argument.
I would appreciate some help in this issue.
Sub InspectAssembly()
Dim oApp As AssemblyDocument
Set oApp = ThisApplication.ActiveDocument
Dim oPart As ComponentOccurrence
For Each oPart In oApp.ComponentDefinition.Occurrences
MsgBox oPart.Name
If oPart.SubOccurrences.Count > 0 Then LoopAssembly (oPart)
Next
End Sub
Function LoopAssembly (Asse As ComponentOccurrence)
Dim oPartfunc As ComponentOccurrence
For Each oPartfunc In Asse.SubOccurrences
MessageBox.Show (oPartfunc.Name)
If oPartfunc.SubOccurrences.Count > 0 Then LoopAssembly (oPartfunc)
Next
End Function
Thank you
Solved! Go to Solution.