[Paraview] ExtractSelection() and SelectionQuerySource() in Python shell

Antti Vanne antti.vanne at kuava.fi
Wed Jun 12 03:38:11 EDT 2013


Got this working by setting input explicitly. Though I'm not quite
following the magic Render() does with the proxies... This script runs fine
in Python shell

from paraview.simple import *

inp = GetActiveSource()
ex = ExtractSelection()
sqs = SelectionQuerySource(FieldType="POINT", QueryString =
"mag(Surface_pressure) >= 100")
ex.Selection = sqs
ex.Input = inp
Render()
Show(ex)
Render()




2013/6/12 Antti Vanne <antti.vanne at kuava.fi>

> Hi there,
>
> I'm running Paraview 4.0 RC 2 and trying to make a selection from Python
> shell. First I used the Find Data dialog with Python trace to get on track
> and then do it all from the shell.
>
> I have a Legacy VTK source with 2Tuple point data, and would like to
> extract a selection based on the point data magnitude (Surface_pressure).
> The following commands are given in the shell:
>
> ex = ExtractSelection()
>
> sqs = SelectionQuerySource( ProcessID=-1,
> QueryString='mag(Surface_pressure) >= 100', HierarchicalIndex=-1,
> FieldType='POINT', HierarchicalLevel=-1)
> ex.Selection = sqs
> Show()
>
> but I get the following runtime exception
>
> Traceback (most recent call last):
>
> File "<console>", line 1, in <module>
>
> File
> "/usr/local/ParaView-4.0.0-RC2-Linux-64bit/lib/paraview-4.0/site-packages/paraview/simple.py",
> line 300, in Show
>
> raise RuntimeError, "Could not create a representation object for proxy
> %s" % proxy.GetXMLLabel()
>
> RuntimeError: Could not create a representation object for proxy
> SelectionQuerySource
>
> The Python trace does not help as it does not show any proxy handling. Is
> this a proxy issue or something else? Thanks.
>
>
>


-- 
Antti Vanne
Kuava Oy
Microkatu 1
PL 1188
70211 Kuopio Finland
tel. +358 50 356 6744
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130612/56cc4bb1/attachment.htm>


More information about the ParaView mailing list