Paraview python scripting with For Loop isn't working for ExtractionSelection
I have a vtkPolyData dataset composed of just points with a number of data arrays. I am trying to use python scripting within Paraview to automate the extraction of point's with specific values. Only the first selection query, in the first increment of the loop, works correctly. All the other queries from other increments return the first selection even through the query string is correct for each particular increment in the loop.
`
from paraview.simple import * from paraview import servermanager as sm reader = GetActiveSource() for i in range(5): ... selection = SelectPoints() ... q_string = "norm_level == " + str(i) ... print(q_string) ... selection.QueryString = q_string ... selection.FieldType = 'POINT' ... sname = str(i) ... mySelection = ExtractSelection(registrationName=sname, Input=reader, Selection=selection) ... mySelection.UpdatePipeline() ... norm_level == 0 norm_level == 1 norm_level == 2 norm_level == 3 norm_level == 4 ` The extracted selections are all the same when they should be different for each of the 5 queries. All extracted selections are returning the result for the query "norm_level == 0" when though the query string is different for each query.
Any ideas to fix?