[Paraview] Threshold filter in python script

Jay Oswald jjo.lists at gmail.com
Fri Jun 19 12:52:57 EDT 2009


I'm trying to plot a (2D) mesh in wireframe mode and then on top of that
plot a single element in yellow with a script in python with ParaView 3.4.
My thought was to use the threshold plot, but it seems not to plot anything
but blank.  This is what I've gotten so far.  Any ideas?  Also, is there any
good reference material out there for ParaView's python API?

   # load mesh and create a view
   if not ActiveConnection:
       connection = Connect()
   exo = sources.ExodusIIReader(FileName='mesh.e')
   exo.UpdatePipelineInformation()
   view = CreateRenderView()
   # now make a threshold with GlobalElementId and plot element 10
   elementID = 10
   tf = filters.Threshold(Input=exo,
ThresholdBetween=[elementID,elementID],SelectInputScalars=["GlobalElementId"])

   tf.UpdatePipeline()
   rep = CreateRepresentation(exo, view)
   rep.Representation = 1 # 1=wireframe
   view.ResetCamera()
   view.StillRender()

Thanks,
Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090619/279fb5d1/attachment.htm>


More information about the ParaView mailing list