# SaveData in Paraview 4.0.1

**URL:** https://discourse.paraview.org/t/savedata-in-paraview-4-0-1/8604
**Category:** ParaView Support
**Tags:** python
**Created:** [December 10, 2021, 1:29pm UTC](https://discourse.paraview.org/t/savedata-in-paraview-4-0-1/8604 "2021-12-10T13:29:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![LuFuchs](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/bcef8e/32.png) [@LuFuchs](https://discourse.paraview.org/u/LuFuchs)
#### Post date: [December 10, 2021, 1:29pm UTC](https://discourse.paraview.org/t/savedata-in-paraview-4-0-1/8604/1 "2021-12-10T13:29:30Z")

</div>

Hello,

I am trying to extract a mean value of a property (e.g. the viscosity) from a 3D model, ideally I would like to do it with pvpython to automate it. In the GUI it works some how, using a threshold to confine the region and then applying an integrate filter. Saving the data is a bit messy (using Save Data) but it works. I tried to produce a script with the trace option, but the saving part does not show up.

I am using Paraview 4.0.1 (which apparently uses python 2.7…). I do have the feeling, that this is a Paraview Version problem (unfortunately, I couldn’t find an answer online), but since I am using Paraview on a network and I don’t have admin rights I am a little reluctant to ask IT to update it.

Thanks in advance for the help! Highly appreciated!

When I try to use the SaveData(“sample.csv”,source) command in the script I do get the error:

pvbatch paraview\_test.py  
Traceback (most recent call last):  
File “paraview\_test.py”, line 67, in   
SaveData(“sample.csv”,IntegrateVariables12)  
NameError: name ‘SaveData’ is not defined

The script looks more or less like this:

try: paraview.simple  
except: from paraview.simple import \*  
paraview.simple.\_DisableFirstRenderCameraReset()

Fault\_Reactivation\_pvd = PVDReader( FileName=’…’)  
Threshold12 = Threshold()  
Threshold12.Scalars = [‘POINTS’, ‘phase []’]  
Threshold12.ThresholdRange = [2.0, 2.0]

IntegrateVariables12 = IntegrateVariables()

SaveData(“sample.csv”,IntegrateVariables12)

Best,

Lukas

---

<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: [December 10, 2021, 5:39pm UTC](https://discourse.paraview.org/t/savedata-in-paraview-4-0-1/8604/2 "2021-12-10T17:39:20Z")

</div>

Hi Lucas,

Welcome to the ParaView community!

Your version of ParaView is so old that I will be very surprised if you even get an answer. ParaView’s Python has come a long ways since 4.0.1. Couldn’t you just download ParaView as a .zip file to your desktop, unzip it and run it from there?

Alan

---

<div class="post-metadata">

### Author: ![LuFuchs](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/bcef8e/32.png) [@LuFuchs](https://discourse.paraview.org/u/LuFuchs)
#### Post date: [December 13, 2021, 9:20am UTC](https://discourse.paraview.org/t/savedata-in-paraview-4-0-1/8604/3 "2021-12-13T09:20:13Z")

</div>

Hello Alan,

thanks for welcoming me! Indeed, your suggestion was very helpful. I thought I need to build paraview on my linux machine but it works with the binaries as well.

Thanks!

Best,

Lukas
