[Paraview] Loadin Python Script

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Jul 3 09:37:32 EDT 2008


Patrick,

> Is it possible to load python files into Paraview from the terminal?
> Something along the lines of 'paraview -cl code.py' (pretending that the
> cl option would load this python script directly into paraview.)
There is no such option currently available. Please feel free to add a 
feature request to the bug tracker for the same at 
http://www.paraview.org/Bug


> Also, I have been looking over some of the functions that paraview has
> built into python, but I could not find one that can loads pvd files. Is
> it possible to do this? Let me know.
http://paraview.org/Wiki/images/f/f9/Servermanager2.pdf describes how to 
create readers. You'll need to use the "PVDReader" 
(sources.PVDReader()). Here's a simple example:

import paraview.servermanager
sm = paraview.servermanager
sm.Connect()
reader = sm.sources.PVDReader(FileName="/tmp/foo.pvd")
view = sm.CreateRenderView()
repr = sm.CreateRepresentation(reader, view)
view.ResetCamera()
view.StillRender()


Utkarsh


More information about the ParaView mailing list