# How can I get cell's type from Polydata or UGrid ?

**URL:** https://discourse.vtk.org/t/how-can-i-get-cells-type-from-polydata-or-ugrid/5379
**Category:** Support
**Created:** [March 14, 2021, 2:27am UTC](https://discourse.vtk.org/t/how-can-i-get-cells-type-from-polydata-or-ugrid/5379 "2021-03-14T02:27:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![11114](https://discourse.vtk.org/user_avatar/discourse.vtk.org/11114/32/2979_2.png) [@11114](https://discourse.vtk.org/u/11114)
#### Post date: [March 14, 2021, 2:27am UTC](https://discourse.vtk.org/t/how-can-i-get-cells-type-from-polydata-or-ugrid/5379/1 "2021-03-14T02:27:26Z")

</div>

Hi, I want to get each individual cell’s type from polydata or UGrid source , I looked up the online documentation , but I didn’t find any useful method there, I think I need to do some conversion ,But don’t know how ,any suggestion ? thanks !

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [March 14, 2021, 8:30pm UTC](https://discourse.vtk.org/t/how-can-i-get-cells-type-from-polydata-or-ugrid/5379/2 "2021-03-14T20:30:56Z")

</div>

From vtkDataSet.h: (superclass of vtkPolyData and vtkUnstructuredGrid)

/\*\*

- Get type of cell with cellId such that: 0 \<= cellId \< NumberOfCells.
- THIS METHOD IS THREAD SAFE IF FIRST CALLED FROM A SINGLE THREAD AND
- THE DATASET IS NOT MODIFIED  
\*/  
virtual int GetCellType(vtkIdType cellId) = 0;
