Many thanks,
Your code helped me a lot 🙂
I changed it a little 🙂
Dim oSheets As Sheets = ThisDoc.Document.Sheets
Dim oSheet As Sheet
For Each oSheet In oSheets
oView = oSheet.DrawingViews.Item(1).Name
Dim sumString As String = ""
Dim oDoc As Document = oSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
For Each oRefDoc As Document In oDoc.AllReferencedDocuments
Dim oCount As Integer = oDoc.ComponentDefinition.Occurrences.AllReferencedOccurrences(oRefDoc).Count
If oCount > 0 Then
sumString = sumString & vbCrLf & IO.Path.GetFileNameWithoutExtension(oRefDoc.DisplayName) & " -> " & oCount
End If
Next
Else
Logger.Info("view doesn't reference an assembly")
End If
Logger.Info(sumString)
Next
HenrykKonczylo_0-1631023244572.png