# vtkDataSet.SafeDownCast probleam

**URL:** https://discourse.vtk.org/t/vtkdataset-safedowncast-probleam/2580
**Category:** Support
**Created:** [February 11, 2020, 3:14pm UTC](https://discourse.vtk.org/t/vtkdataset-safedowncast-probleam/2580 "2020-02-11T15:14:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hao\_hu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hao_hu/32/1382_2.png) [@hao\_hu](https://discourse.vtk.org/u/hao_hu)
#### Post date: [February 11, 2020, 3:14pm UTC](https://discourse.vtk.org/t/vtkdataset-safedowncast-probleam/2580/1 "2020-02-11T15:14:59Z")

</div>

I wrote a statement `ds = vtk.vtkDataSet.SafeDownCast(reader.GetOutput().GetBlock(i))` in python. I want to convert this data to vtkDataSet type but the converted ds is NoneType. I don’t know what went wrong, can anyone tell me something.By the way `reader.GetOutput().GetBlock(i)` output type is `vtkMultiBlockDataSet`

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [February 11, 2020, 5:09pm UTC](https://discourse.vtk.org/t/vtkdataset-safedowncast-probleam/2580/2 "2020-02-11T17:09:37Z")

</div>

If the block is a vtkMultiBlockDataSet then you will also have to iterate through its blocks (possibly recursively) until you finally find a vtkDataSet.

Note that vtkMultiBlockDataSet is not a subclass of vtkDataSet.

---

<div class="post-metadata">

### Author: ![hao\_hu](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hao_hu/32/1382_2.png) [@hao\_hu](https://discourse.vtk.org/u/hao_hu)
#### Post date: [February 14, 2020, 12:29pm UTC](https://discourse.vtk.org/t/vtkdataset-safedowncast-probleam/2580/3 "2020-02-14T12:29:40Z")

</div>

I do not know how can i do will solve it,so can you tell me what should i do.Thank you
