[Paraview] PV3 : Python script for extracting transient values

Julien Duclos juliolatengo at gmail.com
Tue Aug 21 03:08:59 EDT 2007


Hi all,

For each timestep, I would like to extract in a file values on a point (or a
line) generated from Ensight transient data. I think that a Python script is
the only solution. Plot Point Over Time  on Binary Ensight crashes with PV
3.0.1

So I started with this script :

import paraview
paraview.ActiveConnection = paraview.Connect()

# Read Ensight File
reader = paraview.CreateProxy("sources", "ensight", "sources")
# Set Little Endian as ByteOrder
reader.SetByteOrder(1)

reader.SetCaseFileName("mycasename.case")

# o2 is the scalar I would like to export in a file
reader.SetPointArrayStatus('o2','1')

reader.UpdateVTKObjects ()

# Extract DataSet # 7 (necessary to make available the Plot Over Line
filter)
extractgroup = paraview.CreateProxy("filters", "ExtractLevel", "sources",
"ExtractLevel1")
extractgroup.SetInput( reader )
extractgroup.SetGroupRange(7,7)

Everything seems OK but then I am stuck.
- I do not know how the Plot Over Line filter is called with a Python script
- I do not know how to create a loop on the timestep so that I can export
results for each timestep value in a file
- extracting data from PlotOverLine filter in a file  is OK (see message
from Olivier Ricou on June 13th)

Can anybody help me with a small example ?
Thank you very much in advance
Regards

-- 
Julien Duclos
Research Engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20070821/bb285114/attachment.htm


More information about the ParaView mailing list