# vtkXMLMultiBlockDataWriter does not appear to export field data

**URL:** https://discourse.vtk.org/t/vtkxmlmultiblockdatawriter-does-not-appear-to-export-field-data/3669
**Category:** Support
**Created:** [June 29, 2020, 8:27pm UTC](https://discourse.vtk.org/t/vtkxmlmultiblockdatawriter-does-not-appear-to-export-field-data/3669 "2020-06-29T20:27:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![scotsman60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/scotsman60/32/6000_2.png) [@scotsman60](https://discourse.vtk.org/u/scotsman60)
#### Post date: [June 29, 2020, 8:27pm UTC](https://discourse.vtk.org/t/vtkxmlmultiblockdatawriter-does-not-appear-to-export-field-data/3669/1 "2020-06-29T20:27:28Z")

</div>

Hello!!!

I’m using vtkMultBlockDatasets and I want to attach metadata to some of the Blocks, persist that metadata to disk and then use it when I read the file later.

So far, I’ve been successful using the provided NAME metadata associate a name with the Block

```
parent.GetMetaData(block_id).Set(vtk.vtkCompositeDataSet.NAME(), assembly_name)

```

But now I need to add more data and I’m not having any success.

I tried two approach so far,

First, using field data

```
    assembly = vtk.vtkMultiBlockDataSet()
    block_type = vtk.vtkStringArray()
    block_type.SetNumberOfValues(1)
    block_type.SetName("blocktype")
    block_type.SetValue(0, "Assembly")
    assembly.GetFieldData().AddArray(block_type)
    field_data = assembly.GetFieldData().GetAbstractArray("blocktype")
    print(field_data.GetValue(0))

```

The field data is added and recovered but is NOT exported when I write the file to disk using vtkXMLMultiBlockDataWriter()

Then I tried using one of the other standard keys,

```
parent.GetMetaData(block_id).Set(vtk.vtkCompositeDataSet.DATA_TYPE_NAME(), "Assembly")

```

But this is not present in the exported file either.

How can I attach metadata to Blocks and have this data exported to disk?

Thanks in advance,

Doug

---

<div class="post-metadata">

### Author: ![scotsman60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/scotsman60/32/6000_2.png) [@scotsman60](https://discourse.vtk.org/u/scotsman60)
#### Post date: [June 29, 2020, 8:48pm UTC](https://discourse.vtk.org/t/vtkxmlmultiblockdatawriter-does-not-appear-to-export-field-data/3669/2 "2020-06-29T20:48:31Z")

</div>

OK - I just looked at the implementation of vtkXMLMultiBlockDataWriter and it’s clearly only looking for the NAME metadata.

So I’m guessing this is a bust.

Can anyone suggest alternate strategies? I guess I could write a companion file, or encode the additional information into the name string…
