# How to get block indexes in Python

**URL:** https://discourse.paraview.org/t/how-to-get-block-indexes-in-python/797
**Category:** ParaView Support
**Created:** [October 25, 2018, 6:40pm UTC](https://discourse.paraview.org/t/how-to-get-block-indexes-in-python/797 "2018-10-25T18:40:04Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [April 17, 2020, 10:40am UTC](https://discourse.paraview.org/t/how-to-get-block-indexes-in-python/797/4 "2020-04-17T10:40:11Z")

</div>

looks like you already opened your own topic.

> [@Get block name and ID from multiblock dataset](https://discourse.paraview.org/t/get-block-name-and-id-from-multiblock-dataset/4014/10):
>
> I´ve tried to use the following code but it prints out the same results. Is “OpenDataFile” the right way to read the .plt file? from paraview.simple import \* reader = OpenDataFile('C:\\Users\\paul\\.............\\techplotfile.plt') def getBlockIndices(compositeDataInformation, index=0): localDict = {} if compositeDataInformation.GetDataIsMultiPiece(): index += compositeDataInformation.GetNumberOfChildren() else: if compositeDataInformation.GetDataIsComposite(): …

Please do not necro-bump.

---

_[View the full topic](https://discourse.paraview.org/t/how-to-get-block-indexes-in-python/797)._
