Code:
Sub Verwendung()Dim oinv As Inventor.Application
Set oinv = ThisApplication
Dim oAIMDAddIn As ApplicationAddIn
For Each appl In ThisApplication.ApplicationAddIns
If appl.DisplayName = "Productstream Professional" Then
Set oAIMDAddIn = appl
End If
Next
If oAIMDAddIn Is Nothing Then
Exit Sub
End If
Dim oAIMDAutomation As AIMDAutomation
Set oAIMDAutomation = oAIMDAddIn.Automation
Dim oAIMKEY As String
Dim oVerw As String
If oinv.ActiveDocument Is Nothing Then
Exit Sub
End If
If oinv.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Exit Sub
End If
oAIMKEY = oAIMDAutomation.Compass.GetAIMKEY(oinv.ActiveDocument)
Call oAIMDAutomation.Compass.Call("___Environment", "ROE_Verwendung=")
Call oAIMDAutomation.Compass.Call("___ForAllRela", "db=Folder_Xref_Parent_Document (X_CHILD_AIMKEY='" & oAIMKEY & "') ___Environment ROE_Verwendung=$(ROE_Verwendung)|#(AIMKEY)")
oVerw = oAIMDAutomation.Compass.Prepare("$ROE_Verwendung")
oVerw = Right(oVerw, Len(oVerw) - 1)
Dim oErg() As String
Dim test As Variant
oErg = Split(oVerw, "|")
End Sub