Thanks @WCrihfield,
I got to read the RangeBox property of the AssemblyComponentDefinition.
However the results seem to be the same for my cases.
I build in another iLogic which cycles through the occurrences and suppresses everything which is a reference part or assembly according to BOM structure.
This seems to work fine, until I find some errors later and figure out why this is troubeling in another subroutine.
Just if anybody is interested:
XMax = Round(Measure.ExtentsLength, 0)
YMax = Round(Measure.ExtentsWidth, 0)
ZMax = Round(Measure.ExtentsHeight, 0)
Dim adoc As AssemblyDocument = ThisDoc.Document
'Dim aComp As AssemblyComponentDefinition
aComp = adoc.ComponentDefinition
Dim aOcc As ComponentOccurrence
Dim supArray As New ArrayList
' supArray.Add("sup")
'Position der Detailgenauigkeit erfassen
Dim ActLOD As String = aComp.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name
' Für jede Occurrence (subobjekt in BG) prüfen ob Referenzteil
For Each aOcc In aComp.Occurrences
If aOcc.BOMStructure = kReferenceBOMStructure Then
'get current state
If Not aOcc.Suppressed Then
'array definieren/befüllen merken
' MsgBox("Nicht unterdrückt")
supArray.Add("notSup")
'dann unterdrücken
aOcc.Suppress
Else
'ebenfalls array befüllen
' MsgBox("Bereits unterdrückt")
supArray.Add("Sup")
End If
End If
Next
'InputListBox("Found references?",supArray,supArray(0),"Test")
'Maße auslesen
XaMax = Round(Measure.ExtentsLength, 0)
YaMax = Round(Measure.ExtentsWidth, 0)
ZaMax = Round(Measure.ExtentsHeight, 0)
Dim iaOcc As Integer = 0
''Anschließend zurücksetzen
For Each aOcc In aComp.Occurrences
If aOcc.BOMStructure = kReferenceBOMStructure Then
'unsuppress if it wasn't suppressed in the first place
If supArray(iaOcc)="notSup" Then
aOcc.Unsuppress
iaOcc = iaOcc + 1
'leave suppressed
Else If supArray(iaOcc)="Sup" Then
iaOcc = iaOcc+1
End If
End If
Next
'Position der Detailgenauigkeit zurücksetzen
aComp.RepresentationsManager.LevelOfDetailRepresentations.Item(ActLOD).Activate
boxMaxX = aComp.RangeBox.MaxPoint.X*10
boxMaxY = aComp.RangeBox.MaxPoint.Y*10
boxMaxZ = aComp.RangeBox.MaxPoint.Z*10
boxMinX = aComp.RangeBox.MinPoint.X*10
boxMinY = aComp.RangeBox.MinPoint.Y*10
boxMinZ = aComp.RangeBox.MinPoint.Z*10
XeMax = Round(boxMaxX - boxMinX)
YeMax = Round(boxMaxY - boxMinY)
ZeMax = Round(boxMaxZ - boxMinZ)
'XeMax = Round(Measure.ExtentsLength, 0)
'YeMax = Round(Measure.ExtentsWidth, 0)
'ZeMax = Round(Measure.ExtentsHeight, 0)
MessageBox.Show("Start" & " | " & "Testmaße" & " | " & "Endmaße" & _
vbCrLf & "X = " & XMax & " | " & "Xa = " & XaMax & " | " & "Xe = " & XeMax & _
vbCrLf & "Y = " & YMax & " | " & "Ya = " & YaMax & " | " & "Ye = " & YeMax & _
vbCrLf & "Z = " & ZMax & " | " & "Za = " & ZaMax & " | " & "Ze = " & ZeMax, _
"Maße") 'Titel