# how to access unknown blocks via python

**URL:** https://discourse.paraview.org/t/how-to-access-unknown-blocks-via-python/10667
**Category:** ParaView Support
**Created:** [November 3, 2022, 3:23pm UTC](https://discourse.paraview.org/t/how-to-access-unknown-blocks-via-python/10667 "2022-11-03T15:23:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![FerdiFuchs](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/e68b1a/32.png) [@FerdiFuchs](https://discourse.paraview.org/u/FerdiFuchs)
#### Post date: [November 3, 2022, 3:23pm UTC](https://discourse.paraview.org/t/how-to-access-unknown-blocks-via-python/10667/1 "2022-11-03T15:23:20Z")

</div>

Hello everyone,

im digging here in the forum, but i cant get a working solution.  
Im importing an ensight case and i want to access different patches of my cfd-domain to gain surface-averaged values of these patches depending on the patch name (for each outlet\*)

i know, i can extract these with extractblock and i know also about the syntax changes of extractblock for selecting these blocks from my vtkmultiblockdataset.  
What i dont know, is the name of these blocks.

How can i retrieve, for example a list in python, with all the block names and maybe the case structure? Im really sorry, but i cant a working solution.

if i do the following:

```auto
...
ensightReader = EnSightReader(registrationName='ensightReader.case', CaseFileName='/path/to/ensight.case')
numberOfDataSets = ensightReader.GetDataInformation().DataInformation.GetNumberOfDataSets
print(numberOfDataSets)

```

it returns only 0

on the other hand, i know my case shows some hierarchical blocks:  
 ![grafik](https://discourse.paraview.org/uploads/default/original/2X/9/9d23c35af6ec0d94a3267f5f73bad4e2183d98f0.png)

is someone here who can help me with this? im not very experienced with acessing paraview via python, but i learn quickly and i think the problem is really easy.

Allow me to point out, im just using the openfoam pitzdaily case as an minimal working example.

Thank you all very much.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 7, 2022, 7:05am UTC](https://discourse.paraview.org/t/how-to-access-unknown-blocks-via-python/10667/2 "2022-11-07T07:05:14Z")

</div>

Hi @FerdiFuchs ,

You need to use the DataInformation API:  
[https://kitware.github.io/paraview-docs/latest/cxx/classpqOutputPort.html#a8e04d589198ebbb5da10ebfb7c97f2dc](https://kitware.github.io/paraview-docs/latest/cxx/classpqOutputPort.html#a8e04d589198ebbb5da10ebfb7c97f2dc)

That’s a starting point, do not hesitate if you need further help.

Best,

---

<div class="post-metadata">

### Author: ![FerdiFuchs](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/e68b1a/32.png) [@FerdiFuchs](https://discourse.paraview.org/u/FerdiFuchs)
#### Post date: [November 7, 2022, 12:50pm UTC](https://discourse.paraview.org/t/how-to-access-unknown-blocks-via-python/10667/3 "2022-11-07T12:50:55Z")

</div>

Thanks @mwestphal ,

thats what i did. Sadly the the output told me, there are 0 blocks in my dataset, which is wrong (as displayed in the paraview picture).

But i found out during the weekend, that its important to call updatepipeline after reading the dataset:

```auto
UpdatePipeline(proxy=ensightReader)

```

Thanks for very much,  
FerdiFuchs
