[Paraview] Threshold filter in python script
Berk Geveci
berk.geveci at kitware.com
Fri Jun 19 16:48:15 EDT 2009
Try this horrible incantation instead:
tf.SelectInputScalars = ['0', '0', '0', '1', 'GlobalElementId']
In 3.6, this script will be:
from paraview.simple import *
e = ExodusIIReader(FileName='mesh.e')
tf = Threshold(e, ThresholdRange = [10, 10], Scalars = ['CELLS',
'GlobalElementId'])
Show(tf)
Render()
-berk
On Fri, Jun 19, 2009 at 12:52 PM, Jay Oswald<jjo.lists at gmail.com> wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
More information about the ParaView
mailing list