# Division of multi block data set

**URL:** https://discourse.paraview.org/t/division-of-multi-block-data-set/12642
**Category:** ParaView Support
**Tags:** vtk
**Created:** [August 3, 2023, 11:19am UTC](https://discourse.paraview.org/t/division-of-multi-block-data-set/12642 "2023-08-03T11:19:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![h1773](https://discourse.paraview.org/user_avatar/discourse.paraview.org/h1773/32/12141_2.png) [@h1773](https://discourse.paraview.org/u/h1773)
#### Post date: [August 3, 2023, 11:19am UTC](https://discourse.paraview.org/t/division-of-multi-block-data-set/12642/1 "2023-08-03T11:19:17Z")

</div>

Hello,  
I am new for VTK. I have loaded one vtk file in paraview which have the multiblock data set in it and it have cells and faces in it (unstructured grid). I have filed data as will in it. I want to divide this cells and faces based on filed data i exported.  
As an example cells have domain id in range [4,100] in cells and i exported field data domain id vs name i.e. domain id 4 has the name of inlet. now i want to divide cells based on domain id and give its name same as what is corresponding to filed data.  
It is now:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/2/2eb7bc10e6e011c0195e23e37854c3370ddeec71.png)

I want something like:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/4/40b51e2c9174da669c1efb0732d52cc724b7e494.png)

i was using following script as a reference:

```auto
import vtk
inp = self.GetInputDataObject(0, 0)
out = self.GetOutput()

outData = vtk.vtkMultiBlockDataSet()

thresh = vtk.vtkThreshold()
thresh.SetInputData(inp)
thresh.SetInputArrayToProcess(0,0,0,vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS,'RegionId')
rangeID = inputs[0].CellData.GetArray('RegionId').GetRange()

for ic in range(int(rangeID[0]), int(rangeID[1])):
    thresh.ThresholdBetween(ic-0.5,ic+0.5)
    thresh.Update()
    tooutData = thresh.GetOutputDataObject(0)
    outData.SetBlock(ic,tooutData)

out.DeepCopy(outData)

```

source of script: [How to create a collection of blocks (multi block) based on connectivity - ParaView Support - ParaView](https://discourse.paraview.org/t/how-to-create-a-collection-of-blocks-multi-block-based-on-connectivity/9124/4)
