Juan,

Doing programmable selections is not well supported in Python presently.
There will hopefully be future developments towards this in the near term.

For now, you can do something like:

from paraview import vtk

source = GetActiveSource()

idss = IDSelectionSource(IDs=[0, 2, 0, 3, 0, 4], FieldType=vtk.
vtkSelectionNode.POINT)

ex = ExtractSelection(Input=source, Selection=idss)

Show(ex)

This will select points 2, 3, and 4 from the currently selected data
source. Note that the list of IDs have the order [processor ID, point/cell
ID, processor ID, point/cell ID, ...].

You can find documentation on additional selection types at
https://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/paraview.servermanager_proxies.html

HTH,
Cory

On Thu, Apr 26, 2018 at 3:19 AM, <[email protected]> wrote:

> Hello,
>
> I am working to make a selection of points from a unstructured grid
> (associated to a .xmf file) in Paraview  to carry out a FFT of them later
> on. Doing this by using the GUI of Paraview is fairly  straightforward
> since there are several options to select these points. However, I need to
> this by coding it from the python shell option.
>
> I have already looked several books, presentations and help online without
> finding an example or a specific explanation about how to code the
> selection of  points by using python.
>
> I would really appreciate your help regarding this subject,
>
> Regards,
>
> Juan
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/paraview
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview

Reply via email to