Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: j.pavlicek

the problem here is that:

occ.ReferencedDocumentDescriptor.ReferencedDocument

returns an object instead of a document (as you might expect). Anyway, the following might be a bit cleaner code:

Dim doc As AssemblyDocument = ThisDoc.Document
Dim refDocs = doc.ComponentDefinition.Occurrences.Cast(Of ComponentOccurrence).
    Select(Of Document)(Function(occ) occ.ReferencedDocumentDescriptor.ReferencedDocument).
    Distinct().ToList()

For Each refDoc As Document In refDocs
    Logger.Info(refDoc.DisplayName)
Next

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com