# Access coordinates of RectilinearGrid data (Programmable Filter)

**URL:** https://discourse.paraview.org/t/access-coordinates-of-rectilineargrid-data-programmable-filter/9892
**Category:** ParaView Support
**Created:** [June 23, 2022, 9:01am UTC](https://discourse.paraview.org/t/access-coordinates-of-rectilineargrid-data-programmable-filter/9892 "2022-06-23T09:01:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [June 23, 2022, 9:01am UTC](https://discourse.paraview.org/t/access-coordinates-of-rectilineargrid-data-programmable-filter/9892/1 "2022-06-23T09:01:16Z")

</div>

Does anyone happen to know how to access the coordinates of grid points for a RectilinearGrid from within a programmable filter?

I have given up searching the internet for a solution.

This works, but it’s so slow, it’s unusable:  
[https://cvw.cac.cornell.edu/ParaViewAdv/progfilter](https://cvw.cac.cornell.edu/ParaViewAdv/progfilter)

The grid coordinates have to be stored as three 1D vectors somewhere, but how can I access them?

Unfortunately, I don’t have a MWE. If just Paraview had a rectilinear grid source in the Sources menu …

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [June 23, 2022, 2:53pm UTC](https://discourse.paraview.org/t/access-coordinates-of-rectilineargrid-data-programmable-filter/9892/2 "2022-06-23T14:53:38Z")

</div>

You can get the X coordinates array with [vtkRectilinearGrid::GetXCoordinates()](https://vtk.org/doc/nightly/html/classvtkRectilinearGrid.html#aa897412f29bf0ef1350b9bd985248350)

---

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [June 23, 2022, 3:24pm UTC](https://discourse.paraview.org/t/access-coordinates-of-rectilineargrid-data-programmable-filter/9892/3 "2022-06-23T15:24:50Z")

</div>

Ah thanks @cory.quammen, I should pay more attention to the vtk class documentation.

I had checked the python help, but that doesn’t list `GetXCoordinates`.  
(My input is actually a `vtkMultiBlockDataSet` containing `vtkRectilinearGrid`s.)

```auto
for ind, (block_in, block_out) in enumerate(zip(inputs[0], output)):
    print(help(block_in))

```

shows

 ![Screenshot from 2022-06-23 17-20-17](https://discourse.paraview.org/uploads/default/original/2X/c/c1671a618cbe7e84e547c01250a91fe928a1abc0.png)  
where `GetXCoordinates()` is not listed.

However,

```auto
for ind, (block_in, block_out) in enumerate(zip(inputs[0], output)):
    print(help(block_in.GetXCoordinates))

```

does indeed show

 ![Screenshot from 2022-06-23 17-17-55](https://discourse.paraview.org/uploads/default/original/2X/b/b2d5708f8caad16c970bdcee603a0bf1c1916a76.png)
