# How to extract cell coordinates in python

**URL:** https://discourse.paraview.org/t/how-to-extract-cell-coordinates-in-python/2894
**Category:** ParaView Support
**Created:** [November 2, 2019, 6:51pm UTC](https://discourse.paraview.org/t/how-to-extract-cell-coordinates-in-python/2894 "2019-11-02T18:51:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Miguel\_Angel\_Salazar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/miguel_angel_salazar/32/2319_2.png) [@Miguel\_Angel\_Salazar](https://discourse.paraview.org/u/Miguel_Angel_Salazar)
#### Post date: [November 2, 2019, 6:51pm UTC](https://discourse.paraview.org/t/how-to-extract-cell-coordinates-in-python/2894/1 "2019-11-02T18:51:03Z")

</div>

I have got a PVD file which contains a mesh of hexahedra with a simple scalar field. The PVD file is a collection that links to VTU file. This VTU file is a VTKFile of type UnstructuredGrid. I would like to be able to iterate over each hexahedra and obtain its vertex coordinates. How can I do that in the python interface? Thanks.

---

<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 4, 2019, 7:07am UTC](https://discourse.paraview.org/t/how-to-extract-cell-coordinates-in-python/2894/2 "2019-11-04T07:07:36Z")

</div>

If you want to obtain them in the python shell, you will need to use `servermanager.Fetch` method then use standard VTKPython wrapping.

---

<div class="post-metadata">

### Author: ![vector](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vector](https://discourse.paraview.org/u/vector)
#### Post date: [November 5, 2019, 3:06pm UTC](https://discourse.paraview.org/t/how-to-extract-cell-coordinates-in-python/2894/4 "2019-11-05T15:06:05Z")

</div>

You can try this:  
cell id:0 --\> cell id: max  
pCell = gridActor.GetMapper().GetInput().GetCell(cellId)  
mypoints = pCell.GetPoints()  
coordinate = mypoints.GetBounds()
