Gets the dimensions of an explicit structured grid

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 returns nothing.

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

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:

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

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! :v: