Bounding box of surface

Hello All,

I would like to create bounding box of multiple surfaces but is there a better way to form it gh based on separating or choosing surfaces along x or y direction. Kindly have a look at the attached file where you will find multiple scattered surfaces and box to the right which I would like to achieve.

bounding box.3dm (155.6 KB)

missing

Can’t read your R6 file in R5, but are you aware of the “Union Box” option on BBox?

bbox_union

Yes I am aware of it where it forms union box of all geometry but I need seperate ones. Kindly refer the geometry
here is the rhino 5 version.
bounding box-r5.3dm (156.0 KB)

solved it using centroid locations and extract top and bottom surface and made bounding box of it

For me, your geometry doesn’t clarify either your question or your solution. Maybe you could post your GH file and enlighten us?