# How to get IDs of points attached to the cell?

**URL:** https://discourse.paraview.org/t/how-to-get-ids-of-points-attached-to-the-cell/4314
**Category:** ParaView Support
**Tags:** python
**Created:** [May 12, 2020, 11:36am UTC](https://discourse.paraview.org/t/how-to-get-ids-of-points-attached-to-the-cell/4314 "2020-05-12T11:36:59Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Andrei](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@Andrei](https://discourse.paraview.org/u/Andrei)
#### Post date: [May 13, 2020, 8:25pm UTC](https://discourse.paraview.org/t/how-to-get-ids-of-points-attached-to-the-cell/4314/3 "2020-05-13T20:25:11Z")

</div>

Many thanks for the help!  
I completed the above example according to your advice

```
paraViewData=FindSource('my_project.pvd')
SetActiveSource(paraViewData)
UpdatePipeline()
pythonData=servermanager.Fetch(paraViewData)
numberOfCells=pythonData.GetNumberOfCells()
from vtk import *
cellIds = vtkIdList() # cell ids store to
for cellIndex in range(numberOfCells): # for every cell
   pythonData.GetCellPoints(cellIndex, cellIds) # get ids of points of the given cell
   for i in range(0, cellIds.GetNumberOfIds()): # for every points of the given cell
      coord=pythonData.GetPoint(cellIds.GetId(i)) # get coordinates of the given point of the given cell, type: class 'tuple'
      x=coord[0] # get coordinates of the given point of the given cell, type: class 'float'
      y=coord[1]
      z=coord[2]

```

Regarding the definition of geometric centers of cells the `Cell Centers` filter reliability can be improved by adding the `Clean to Grid` filter before `Cell Centers` as explained here [ParaView Cell Centers possible unstable program behavior](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/4)

---

_[View the full topic](https://discourse.paraview.org/t/how-to-get-ids-of-points-attached-to-the-cell/4314)._
