<div dir="ltr">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<div><br></div><div><div>from paraview.simple import * </div>
<div><br></div><div>inp = GetActiveSource()</div><div>ex = ExtractSelection()</div><div>sqs = SelectionQuerySource(FieldType="POINT", QueryString = "mag(Surface_pressure) >= 100")</div><div>ex.Selection = sqs</div>
<div>ex.Input = inp</div><div>Render()</div><div>Show(ex)</div><div>Render()</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/12 Antti Vanne <span dir="ltr"><<a href="mailto:antti.vanne@kuava.fi" target="_blank">antti.vanne@kuava.fi</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi there, <div><br></div><div>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. </div>
<div><br></div><div>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: </div><div>
<br></div><div>ex = ExtractSelection()</div><div>
<p style="margin:0px"><span style="font-size:9pt;font-family:Courier">sqs = SelectionQuerySource( ProcessID=-1, QueryString='mag(Surface_pressure) >= 100', HierarchicalIndex=-1, FieldType='POINT', HierarchicalLevel=-1)</span></p>
<div>ex.Selection = sqs<br></div><div>Show()</div><div><br></div><div>but I get the following runtime exception</div><div><br></div><div>
<p style="margin:0px"><span style="font-family:Courier;font-size:9pt;color:rgb(255,0,0)">Traceback (most recent call last):</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:9pt;color:rgb(255,0,0)"> File "<console>", line 1, in <module></span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:9pt;color:rgb(255,0,0)"> File "/usr/local/ParaView-4.0.0-RC2-Linux-64bit/lib/paraview-4.0/site-packages/paraview/simple.py", line 300, in Show</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:9pt;color:rgb(255,0,0)"> raise RuntimeError, "Could not create a representation object for proxy %s" % proxy.GetXMLLabel()</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:9pt;color:rgb(255,0,0)">RuntimeError: Could not create a representation object for proxy SelectionQuerySource</span></p></div><div><br></div><div>The Python trace does not help as it does not show any proxy handling. Is this a proxy issue or something else? Thanks. <br>
</div><div><br></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Antti Vanne<br>Kuava Oy<br>Microkatu 1<br>PL 1188<br>70211 Kuopio Finland<br>tel. +358 50 356 6744
</div>