# Can anyone show me how to use one state file multiple times?

**URL:** https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861
**Category:** ParaView Support
**Created:** [November 21, 2020, 1:42pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861 "2020-11-21T13:42:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [November 21, 2020, 1:42pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861/1 "2020-11-21T13:42:34Z")

</div>

According to this post from 2011 it should be possible:

[https://www.paraview.org/pipermail/paraview/2011-August/022387.html](https://www.paraview.org/pipermail/paraview/2011-August/022387.html)

But I cannot find any recent example of how to do so?

I want to do it programmatically, but it just keeps overwriting when I use “LoadState”

Can anyone help?

Kind regards

---

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [November 21, 2020, 2:50pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861/2 "2020-11-21T14:50:09Z")

</div>

I found this issue:

[https://gitlab.kitware.com/paraview/paraview/-/issues/17442](https://gitlab.kitware.com/paraview/paraview/-/issues/17442)

Seems like this was never intended to be used in such a manner. Unfortunate, since I have to do 3 times the work now, but atleast I know now that it is not possible at all

Kind regards

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [November 23, 2020, 7:02pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861/3 "2020-11-23T19:02:27Z")

</div>

I can think of a few ways to pull this off. Lets try the simplest first. In ParaView, Help/ Sandia National Labs Tutorials/ State Management. Also, Python and then Batch.

Try saving your state file as a .py file (rather than pvsc), and then edit it, and run it with pvbatch.

The first post is almost 10 years old. I don’t think it is relevant.

The second post is specific to changing the Translate, down in the Propertes tab. Unless you specificially change the translate in the properties tab, this bug/issue does not apply to your question.

---

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [November 23, 2020, 7:13pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861/4 "2020-11-23T19:13:31Z")

</div>

Hi Walter!

Could you explain to me how to save it as a .py file? I am only aware of saving state files as pvsm - and then I run this state file from pvpython by calling it.

And ah okay, it is just that I have x-folders with a file series, lets say “myfile\*.vtk”. So the files are the same name but located in different folders. When I then tried to run my statefile it would only show me the latest one, since it just overwrite the other “myfile\*.vtk”

Kind regards

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [November 23, 2020, 7:17pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861/5 "2020-11-23T19:17:35Z")

</div>

It’s in the Tutorial… You get the option to save as a .pvsm file. You can change this… Further, this .py is editable…

---

<div class="post-metadata">

### Author: ![AhmedSalih3d](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ahmedsalih3d/32/14109_2.png) [@AhmedSalih3d](https://discourse.paraview.org/u/AhmedSalih3d)
#### Post date: [November 23, 2020, 7:21pm UTC](https://discourse.paraview.org/t/can-anyone-show-me-how-to-use-one-state-file-multiple-times/5861/6 "2020-11-23T19:21:57Z")

</div>

Thanks for making me aware! It is great, seems much better to use than pvsm in the future!

I was not aware that Paraview had a dedicated tutorial, usually I try searching YouTube, but I find very few spending real time on explaining the Python backend/interfacing. Perhaps I need to do some reading in this regards.

I think I should be able to get it to work now, when I need it again in the future.

Kind regards
