[Paraview] ExtractSelection with ids: scripting example

livia.barazzetti at istb.unibe.ch livia.barazzetti at istb.unibe.ch
Thu Oct 15 05:31:03 EDT 2015


Hi,
I would like to use the ExtractSelection filter by providing an ID List, as hinted in the doc  http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.simple.ExtractSelection.html?highlight=extractselection#paraview.simple.ExtractSelection

What is the correct syntax? First I tried :

e = ExtractSelection(Sphere1, [1,2])
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "R:\ParaView 4.4.0\lib\paraview-4.4\site-packages\paraview\simple.py", line 1520, in CreateObject
raise RuntimeError, "Expecting a proxy as input."
RuntimeError: Expecting a proxy as input.


Then I tried:

>>> selection = paraview.simple.IDSelectionSource(ContainingCells=0, FieldType = "POINT", IDs = [0,1])
>>> e = ExtractSelection(Sphere1, Selection = selection)
>>> e.UpdatePipeline()
>>> e.GetDataInformation().GetNumberOfPoints()
1L
#I expected 2 points

and then, when I tried to visualize the result, I got:


ERROR: In C:\bbd\b51c3c7f\source-paraview\ParaViewCore\ServerManager\Rendering\vtkSMParaViewPipelineControllerWithRendering.cxx, line 542

vtkSMParaViewPipelineControllerWithRendering (000000000C747260): Data cannot be shown in the defaulted render view!!

Thanks
Livia

Livia Barazzetti
Ph.D. Student - Medical Image Analysis
Institute for Surgical Technology and Biomechanics
University of Bern
Stauffacherstrasse 78
CH-3014 Bern
Tel +41 31 631 59 48
http://www.istb.unibe.ch<http://www.istb.unibe.ch/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151015/a6aa37f3/attachment.html>


More information about the ParaView mailing list