[Paraview] ParaView python scripting - capture from ParaView GUI

Su, Simon M CTR USAF (US) simon.m.su.ctr at mail.mil
Thu Apr 3 12:47:49 EDT 2014


Hi David,

thanks. What about saving it in to xdmf file format? Is it as simple as doing

writer=CreateWrite("filename.xmf", Cone1)?

or do I need a different writer class?

thanks
-simon

________________________________
From: David E DeMarle [dave.demarle at kitware.com]
Sent: Thursday, April 03, 2014 12:42 PM
To: Su, Simon M CTR USAF (US)
Cc: paraview at paraview.org
Subject: Re: [Paraview] ParaView python scripting - capture from ParaView GUI

------------------ 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/b3b51d14/attachment.html>


More information about the ParaView mailing list