[Paraview] ParaView python scripting - capture from ParaView GUI

David E DeMarle dave.demarle at kitware.com
Thu Apr 3 12:42:32 EDT 2014


------------------ start python script ------------------

>  try: paraview.simple
>
> except: from paraview.simple import *
>
> paraview.simple._DisableFirstRenderCameraReset()
>
>
>  Cone1 = Cone()
>
>
>  RenderView1 = GetRenderView()
>
>
>  DataRepresentation1 = Show()
>
> DataRepresentation1.ScaleFactor = 0.1
>
> DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]
>
>
>  RenderView1.CameraPosition = [0.0, 0.0, 3.2036135254332487]
>
> RenderView1.CameraClippingRange = [2.309882128879306, 4.336364527086367]
>
> RenderView1.CameraParallelScale = 0.8291561935301535
>
>
>  Render()
>
>
> So, what is the python script command I need to save the data and how do I
> turn the python script from the Start Trace output into python script that
> I can run with pvbatch? Anything I need to strip off the output?
>

You don't need to strip anything off the output.

To save results add:
WriteImage("filename.png")
To save the screenshot in png format

And/Or add:

writer= CreateWriter("filename.vtk", Cone1)
writer.UpdatePipeline()

to save the Cone1's data in vtk format
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140403/9bed7450/attachment.html>


More information about the ParaView mailing list