how to access unknown blocks via python

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:

...
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

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.

Hi @FerdiFuchs ,

You need to use the DataInformation API:
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,

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:

UpdatePipeline(proxy=ensightReader)

Thanks for very much,
FerdiFuchs

1 Like