# Assign attributes to the blocks of a vtkMultiBlockDataSet

**URL:** https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565
**Category:** Development
**Tags:** vtk
**Created:** [October 15, 2020, 8:23am UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565 "2020-10-15T08:23:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [October 15, 2020, 8:23am UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/1 "2020-10-15T08:23:02Z")

</div>

I know that we have PointData with attributes, CellData with attributes and FieldData, but I am not aware of anything like BlockData: This would be the thing that I would actually like to use if possible!

But maybe there are other ways to attach informations to the blocks that I do not understand yet!?

I have seen and used so far the possibility to assign labels to these blocks that will appear in the “Multi Block Manager” panel with this:

`block->GetMetaData(inx)->Set(vtkCompositeDataSet::NAME(), "Label");`

I must admit that I have not really understood the logic of this vtkInformation system that seems to be very tricky and powerful, but maybe that would be a way to somehow attach information to blocks that can be evaluated by some other functions later on, or even “survive” being written to a vtm file (file set)?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [October 15, 2020, 11:15am UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/2 "2020-10-15T11:15:24Z")

</div>

The easiest option is probably to simply add whatever arrays you want o add to block to the FieldData of actual vtkDataSet assigned to that block.

---

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [October 15, 2020, 12:47pm UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/3 "2020-10-15T12:47:28Z")

</div>

Well yes - FieldData may be the thing that I am looking for! FieldData of the vtkMultiBlockDataSet would do because the idea is to have the same array names and types for each one of the blocks.

Thanks!

---

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [October 16, 2020, 2:33pm UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/4 "2020-10-16T14:33:07Z")

</div>

Right now I have for example a multiblock dataset (MBDS) containing 6 blocks that are all vtkPolyData. Plus there is now a FieldData object attached to the MBDS with a number of arrays and 6 rows, each one corresponding to one of the blocks.

So far so nice: I can save and reload this MBDS and recover the FieldData, and programmatically I can do something with the FieldData like I want.

However I do not understand the handling of these Field Data in ParaView:

- viewing the MBDS in a render view, I can select any one of the arrays like I can do also for cell or point attribute arrays, I see a legend that corresponds to the data in the array - and that’s it! I know that the fact that I have 6 rows corresponding to the 6 blocks is just my own specification, so I do not expect to see any colored objects - but why then the legend?

- viewing the MBDS in a spreadsheet view, I can switch to “field data” - and see nothing! Why?

I know that I can attach FieldData also to each one of the data blocks, and maybe this would be good for the one or other purpose that I do not know yet, but so far I do attach it to the MBDS object itself.

---

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [October 19, 2020, 8:25am UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/5 "2020-10-19T08:25:34Z")

</div>

I just see that the thing is explained here:

> **[New in ParaView: Coloring by field data - Kitware Blog](https://blog.kitware.com/new-in-paraview-coloring-by-field-data/)**
>
> In some situations, you may have a single data value associated with a data set that you would like to visualize “on” the data set. For ... Read More

Only the link to the example data set “tube.xii” is not any more valid: It would be nice to have that example to fully understand the explanations!

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [October 19, 2020, 1:32pm UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/6 "2020-10-19T13:32:35Z")

</div>

Thanks for reporting the bad, link @cobo. I have updated the link. It points to a file named for the external data SHA-1, so you’ll want to save it as `tube.exo` to make it easier to find on your system.

---

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [October 20, 2020, 6:50am UTC](https://discourse.paraview.org/t/assign-attributes-to-the-blocks-of-a-vtkmultiblockdataset/5565/7 "2020-10-20T06:50:01Z")

</div>

Thanks - works now!
