# Can vtk.vtkRectilinearGrid Objects be used directly ?

**URL:** https://discourse.paraview.org/t/can-vtk-vtkrectilineargrid-objects-be-used-directly/7110
**Category:** ParaView Support
**Tags:** python
**Created:** [April 30, 2021, 9:56am UTC](https://discourse.paraview.org/t/can-vtk-vtkrectilineargrid-objects-be-used-directly/7110 "2021-04-30T09:56:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Berberich](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Berberich](https://discourse.paraview.org/u/Berberich)
#### Post date: [April 30, 2021, 9:56am UTC](https://discourse.paraview.org/t/can-vtk-vtkrectilineargrid-objects-be-used-directly/7110/1 "2021-04-30T09:56:36Z")

</div>

Hi all,  
I am new to paraview.  
In my python simulation program I want to use paraview to view temporary data.

Now I now that I can generate a RectilinearGridDataset save it in XML format and then use:

```
grid = simple.OpenDataFile("./test.vtr")
simple.Show(grid)
simple.Render()
simple.Interact()

```

to generate an Interactive render of the data set.  
Is there a way to skip the need for writing the data to a .vtr file and instead use a vtk.vtkRectilinearGrid object directly as source ?

Cheers,  
Tim

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 30, 2021, 10:05am UTC](https://discourse.paraview.org/t/can-vtk-vtkrectilineargrid-objects-be-used-directly/7110/2 "2021-04-30T10:05:21Z")

</div>

Yes, using a TrivialProducer.

[https://kitware.github.io/paraview-docs/latest/python/paraview.simple.TrivialProducer.html](https://kitware.github.io/paraview-docs/latest/python/paraview.simple.TrivialProducer.html)

---

<div class="post-metadata">

### Author: ![Berberich](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Berberich](https://discourse.paraview.org/u/Berberich)
#### Post date: [April 30, 2021, 10:17am UTC](https://discourse.paraview.org/t/can-vtk-vtkrectilineargrid-objects-be-used-directly/7110/3 "2021-04-30T10:17:50Z")

</div>

That helped, thanks a lot !  
If anyone wants to know,  
here is a link to a question that shows how TrivialProducer is used in a similar case.  
[https://discourse.paraview.org/t/simple-show-trivialproducer-takes-much-time/6826](https://discourse.paraview.org/t/simple-show-trivialproducer-takes-much-time/6826)
