# Gets the dimensions of an explicit structured grid

**URL:** https://discourse.vtk.org/t/gets-the-dimensions-of-an-explicit-structured-grid/4871
**Category:** Support
**Created:** [December 21, 2020, 4:02pm UTC](https://discourse.vtk.org/t/gets-the-dimensions-of-an-explicit-structured-grid/4871 "2020-12-21T16:02:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rodrigomologni](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@rodrigomologni](https://discourse.vtk.org/u/rodrigomologni)
#### Post date: [December 21, 2020, 4:02pm UTC](https://discourse.vtk.org/t/gets-the-dimensions-of-an-explicit-structured-grid/4871/1 "2020-12-21T16:02:53Z")

</div>

Support,

How can I get the dimensions of an explicit structured grid by means of Python code, please?

```
print(grid.GetDimensions())
TypeError: GetDimensions() takes exactly 1 argument (0 given)

```

[GetDimensions](https://vtk.org/doc/nightly/html/classvtkExplicitStructuredGrid.html#ad220b4c97c4c532a23446e749946a0e4) returns nothing.

---

<div class="post-metadata">

### Author: ![Joachim\_P](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joachim_p/32/3272_2.png) [@Joachim\_P](https://discourse.vtk.org/u/Joachim_P)
#### Post date: [December 23, 2020, 10:08am UTC](https://discourse.vtk.org/t/gets-the-dimensions-of-an-explicit-structured-grid/4871/2 "2020-12-23T10:08:31Z")

</div>

The function `vtkExplicitStructuredGrid::GetDimensions` expects an array of 3 integers as parameter.

---

<div class="post-metadata">

### Author: ![Joachim\_P](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joachim_p/32/3272_2.png) [@Joachim\_P](https://discourse.vtk.org/u/Joachim_P)
#### Post date: [December 23, 2020, 10:12am UTC](https://discourse.vtk.org/t/gets-the-dimensions-of-an-explicit-structured-grid/4871/3 "2020-12-23T10:12:41Z")

</div>

As an alternative, you can use the `GetExtent()` function (with no parameter) and you get an array of 6 ints (couples of min, max per dimension). The dimensions returned by `GetDimensions()` correspond to:

```auto
  dims[0] = ext[1] - ext[0] + 1;
  dims[1] = ext[3] - ext[2] + 1;
  dims[2] = ext[5] - ext[4] + 1;

```

---

<div class="post-metadata">

### Author: ![rodrigomologni](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@rodrigomologni](https://discourse.vtk.org/u/rodrigomologni)
#### Post date: [December 23, 2020, 11:53am UTC](https://discourse.vtk.org/t/gets-the-dimensions-of-an-explicit-structured-grid/4871/4 "2020-12-23T11:53:16Z")

</div>

> The function vtkExplicitStructuredGrid::GetDimensions expects an array of 3 integers as parameter.

I thought there was a way to pass a parameter through Python.

> As an alternative, you can use the GetExtent() function (with no parameter)…

Yes, you’re right! Thank you! ✌
