[Paraview] Extract Selection using Python

Albrecht Kyrieleis akyrieleis at gmail.com
Mon Jan 27 09:18:23 EST 2014


Hi,

I am trying to write a Python function that can be used in ParaviewWeb to
extract the values of a point data set after a selection has been made (I
am using basically pv_web_visualizer with a custom protocol that contains
my python functions). I am struggling with 2 problems:

1) I cannot figure out how to display the rectangle for the selection in
ParaviewWeb. With

 RenderView1 = simple.GetRenderView()
 RenderView1.InteractionMode = "Selection"

only the mouse mode is changed, but no rectangle is shown.


2)  Using the normal Paraview GUI, after I have made a selection I can do
in the Python shell:

sel=ExtractSelection()

this creates the Extract Selection filter which I need to finalize using
the 'Apply' button.

In the Python shell I can then access the data in that selection using:

datsel=servermanager.Fetch(sel)
ar0=datsel.GetPointData().GetArray(0)
ar0.GetTuple1(0)

In ParavewWeb, ExtractSelection  does not pick up any selection that I have
made. But it might also be that using the code in 1) is not enough to
enable the selection tool.

in ParaviewWeb, how can I obtain the IDs of the points in the selection so
that I can fetch the values ?

Any help or ideas would be greatly appreciated.

Thank you very much

kyr.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140127/47d9e6cc/attachment.html>


More information about the ParaView mailing list