# GetBounds() for vtkMultiBlockDataSet in Programmable Filter

**URL:** https://discourse.paraview.org/t/getbounds-for-vtkmultiblockdataset-in-programmable-filter/9874
**Category:** ParaView Support
**Created:** [June 22, 2022, 12:12am UTC](https://discourse.paraview.org/t/getbounds-for-vtkmultiblockdataset-in-programmable-filter/9874 "2022-06-22T00:12:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [June 22, 2022, 12:12am UTC](https://discourse.paraview.org/t/getbounds-for-vtkmultiblockdataset-in-programmable-filter/9874/1 "2022-06-22T00:12:49Z")

</div>

I have a `vtkMultiBlockDataSet` and I need to get its bounds in the programmable filter.

 ![Screenshot from 2022-06-22 02-06-25](https://discourse.paraview.org/uploads/default/original/2X/2/25ef24e8dc2d19b2ec5cd8eae804bb06b46a47a2.png)

For single block data I was able to use `GetBounds()` but that does not seem to work for `vtkMultiBlockDataSet`.

Instead, I get the following error:  
 ![Screenshot from 2022-06-22 02-08-02](https://discourse.paraview.org/uploads/default/original/2X/9/988485c0c7e8bb272abb808f0fc32bc24e12d14e.png)

I have tried to figure out what arguments `GetBounds()` needs, but I did not find the help very useful.

 ![Screenshot from 2022-06-22 02-09-40](https://discourse.paraview.org/uploads/default/original/2X/f/f1e383a510cfe3f892e01caeec8c4d9a15f6d80a.png)

Apparently `GetBounds()` needs a list of six floats, but which ones?  
Could anyone give me a hint?

---

<div class="post-metadata">

### Author: ![pindakaas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/cab0a1/32.png) [@pindakaas](https://discourse.paraview.org/u/pindakaas)
#### Post date: [June 22, 2022, 7:10am UTC](https://discourse.paraview.org/t/getbounds-for-vtkmultiblockdataset-in-programmable-filter/9874/2 "2022-06-22T07:10:56Z")

</div>

I think in C++ you would pass an empty double[6] variable in the function call where the bounds information would be saved. It’s C++ specific and not relevant for Python.

As for your problem, a multi-block dataset can have several blocks and each block can have its own bounds, so it makes sense that GetBounds doesn’t work for the whole dataset. You could try first extracting a single block using the ExtractBlock filter, and then apply GetBounds to that. If that doesn’t work, try also MergeBlocks on the ExtractBlock.

---

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [June 23, 2022, 9:08am UTC](https://discourse.paraview.org/t/getbounds-for-vtkmultiblockdataset-in-programmable-filter/9874/3 "2022-06-23T09:08:43Z")

</div>

> [@pindakaas](#):
>
> so it makes sense that GetBounds doesn’t work for the whole dataset

I disagree. I think it makes sense to provide overall bounds for the bounding box.  
And these bounds are printed in the Information tab as well!

Sure, one can iterate over the different blocks like so,

```auto
for ind, (block_in, block_out) in enumerate(zip(inputs[0], output)):
    bounds = block_in.GetBounds()

```

and then combine the individual bounds via `min` and `max` operations.

But the Information tab already prints the total bounds, so they are computed anyway, so why not have `vtkMultiBlockDataSet`’s `GetBounds()` function return those overall bounds.

Instead there is a function `GetBounds()` defined and it does not work.
