Hello all.
Sorry for the late reply.
Firstly, thank you all for your suggestions.
@A.Acheson
I used a little bit simpler approach. I will explain it below.
@Frederick_Law
The thing is, I also need assemblies in the collection, not just parts.
@WCrihfield
I am coloring them with specific colors, depended on which type of the custom property it has. It can be either IPT or IAM, so that why I need the whole collection.
This was the biggest challenge, on how to get whole collection from the top assembly. The struggles I encountered was that I was not able to get occurrences from sub-assemblies or I did get the occurrences, but not the assemblies.
Thank you for the explanation. I did not exacly try this as you suggested. I used a different approach explained below.
Used approach:
I did it in 2 steps. 1st step was to get all referenced documents from the top assembly, so that all IPTs and IAMs are included. When I had this collection, I iterated through all of them and filtered the needed ones out and used them later in code.
Best regards,
Rene Repina