paraview.simple.SelectCells sellect multiple cell

Hi, i just started working with paraview python scripts, and i wanted to know if their was a way to query multiple cells based on their id

similar to this in the editor image

i tried something like this but it didn’t work

paraview.simple.SelectCells(query=“id==1 | id==2 | id==3”)

The following should work:

# create a query selection
paraview.simple.QuerySelect(QueryString='((id == 1) | (id == 2) | (id == 3))', FieldType='CELL')

The easiest way to figure this out is to use the Python tracing capabilities: Tools > Start Trace, check Show Incremental Trace in the Trace Options dialog, and then use the Find Data dialog to do the query.

1 Like