# Deprecated vtkUnstructuredGrid::SetCells

**URL:** https://discourse.vtk.org/t/deprecated-vtkunstructuredgrid-setcells/4277
**Category:** Support
**Created:** [September 22, 2020, 4:31pm UTC](https://discourse.vtk.org/t/deprecated-vtkunstructuredgrid-setcells/4277 "2020-09-22T16:31:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RonRahaman](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ronrahaman/32/2350_2.png) [@RonRahaman](https://discourse.vtk.org/u/RonRahaman)
#### Post date: [September 22, 2020, 4:31pm UTC](https://discourse.vtk.org/t/deprecated-vtkunstructuredgrid-setcells/4277/1 "2020-09-22T16:31:38Z")

</div>

One of our existing apps uses a deprecated form of `vtkUnstructuredGrid::SetCells`. Here it is in [an older Doxygen](https://vtk.org/doc/release/7.1/html/classvtkUnstructuredGrid.html#a02eb2ba6eee9751e8f6f53cd4da0685d):

```auto
void vtkUnstructuredGrid::SetCells	(
  vtkUnsignedCharArray *cellTypes, 
  vtkIdTypeArray *cellLocations,
  vtkCellArray *cells 
)

```

How do I replace it using the latest version of VTK? Can I use this form and omit `cellLocations`?

```auto
void vtkUnstructuredGrid::SetCells	(
  vtkUnsignedCharArray *cellTypes,  
  vtkCellArray *cells 
)

```

---

<div class="post-metadata">

### Author: ![AllisonVacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allisonvacanti/32/2396_2.png) [@AllisonVacanti](https://discourse.vtk.org/u/AllisonVacanti)
#### Post date: [September 24, 2020, 5:48am UTC](https://discourse.vtk.org/t/deprecated-vtkunstructuredgrid-setcells/4277/2 "2020-09-24T05:48:09Z")

</div>

> Can I use this form and omit `cellLocations` ?

Yes. The information that was in `cellLocations` is now directly embedded in the `vtkCellArray`, so it no longer needs to be specified here.

---

<div class="post-metadata">

### Author: ![RonRahaman](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ronrahaman/32/2350_2.png) [@RonRahaman](https://discourse.vtk.org/u/RonRahaman)
#### Post date: [September 30, 2020, 2:25pm UTC](https://discourse.vtk.org/t/deprecated-vtkunstructuredgrid-setcells/4277/3 "2020-09-30T14:25:07Z")

</div>

Great, thank you!
