# CGNSRreader: List all available blocks (patches) in python

**URL:** https://discourse.paraview.org/t/cgnsrreader-list-all-available-blocks-patches-in-python/5095
**Category:** ParaView Support
**Created:** [August 12, 2020, 12:03pm UTC](https://discourse.paraview.org/t/cgnsrreader-list-all-available-blocks-patches-in-python/5095 "2020-08-12T12:03:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jan\_Kaufmann](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jan_kaufmann/32/4707_2.png) [@Jan\_Kaufmann](https://discourse.paraview.org/u/Jan_Kaufmann)
#### Post date: [August 12, 2020, 12:03pm UTC](https://discourse.paraview.org/t/cgnsrreader-list-all-available-blocks-patches-in-python/5095/1 "2020-08-12T12:03:41Z")

</div>

As I do not know the patch names of my cgns file in advance (when loading the file with python), I would like to get a list of all available patches.  
For e.g. OpenFOAM cases this can be done with foamReader.GetProperty(‘PatchArrayInfo’). Is there something similar for the CGNSReader?

Thanks and best regards,  
Jan

---

<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: [August 31, 2020, 10:18am UTC](https://discourse.paraview.org/t/cgnsrreader-list-all-available-blocks-patches-in-python/5095/2 "2020-08-31T10:18:55Z")

</div>

Sadly there is no easy accessor for this one.

However, it can be done this way:

```
domain = reader.GetProperty("Blocks").SMProperty.GetDomain("array_list")
for i in range(0, domain.GetNumberOfStrings()):
  print(domain.GetString(i))
```

---

<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: [August 31, 2020, 11:34am UTC](https://discourse.paraview.org/t/cgnsrreader-list-all-available-blocks-patches-in-python/5095/3 "2020-08-31T11:34:29Z")

</div>

sigh! another reason why we need to revert back to the original block/family selection mechanism. I’ve reported an issue [here](https://gitlab.kitware.com/paraview/paraview/-/issues/20169).
