[Paraview] Getting values from a saved state with a script

Walter Landry walter at geodynamics.org
Tue Sep 16 11:09:17 EDT 2008


Walter Landry <walter at geodynamics.org> wrote:
> Hello,
> 
> I have set up paraview so that it does some calculations and displays
> the result in a spreadsheet.  I can save the state and then load it in
> a script with LoadState().  I know how to save images of the 3D views
> with GetRenderView().WriteImage.  But I have not figured out how to
> get the data from the spreadsheet.  Ideally, I would be like to have
> the script print out a number, although it would be fine to just save
> an image of the spreadsheet.
> 
> I tried getting the list of proxies with 
> 
>   paraview.servermanager.pyProxyManager().GetProxiesOnOcnnection(paraview.servermanager.ActiveConnection)
> 
> I can get a SpreadSheetView object and SpreadSheetRepresentation
> objects, but I do not know what to do with them.  I just can't manage
> to get numbers out.  I am sure there is a way to do it, but I am a bit
> stumped right now.

I figured it out.  I can just connect them to a DataSetWriter using a
script like

  pm=ProxyManager()
  energy=pm.GetProxiesOnConnection(ActiveConnection)["sources"]["IntegrateAttributes3"]
  work=pm.GetProxiesOnConnection(ActiveConnection)["sources"]["IntegrateAttributes2"]
  energy_writer=writers.DataSetWriter(Input=energy,FileType=1,FileName="energy.vtk")
  work_writer=writers.DataSetWriter(Input=work,FileType=1,FileName="work.vtk")
  energy_writer.UpdatePipeline()
  work_writer.UpdatePipeline()

That writes the data to a file.

Cheers,
Walter Landry
walter at geodynamics.org


More information about the ParaView mailing list