Bounding Box of component in assembly

Forums: 

Hi,
I need to extract the information about bounding boxes of all components in the assembly. I can iterate through all the bodies inside component, but .Box property does not give the result for component itself (beside that SNAP reference says that Box is a member of Component class). I'm intrested especially in min and max values in z direction in absolute CSYS of assembly.
Here's example code I'm trying to run:

Imports Snap
Public Class ComponentsBB
Public Shared Sub Main()
Dim workPart As NX.Part = Snap.Globals.WorkPart

For Each comp As NX.Component In workPart.RootComponent.Descendants
InfoWindow.WriteLine(comp.Box.MaxZ & Chr(9) & comp.Box.MinZ)
Next

End Sub

End Class

When you run it, it throws an exception. Any ideas?

It looks like Component.Box is always Nothing. So, then, when you try to get MinZ and MaxZ, you get a NullObject exception.

I couldn't find an easy way to get the bounding box of a component using NX/Open, either.

For now, it looks like you need to iterate through all the objects in the component, combining their bounding boxes.

You should submit a PR, so that we can get this fixed.