The topic is a known bug and was discussed in the past, but I cannot get the proposed workaround to work.
Situation:
My pipeline is created by a Python script. To work on a subset of the data, I use QuerySelect
followed by ExtractSelection
, e. g.:
nmdSel = QuerySelect(QueryString='(nmd == 5)', FieldType='CELL', InsideOut=0)
extractSelectionNMD = ExtractSelection(registrationName='extractSelectionNMD', Input=transform1, Selection=nmdSel)
When I use the SaveState
command, the QuerySelect
part is not saved. When I load the saved state in a new session, the pipeline is broken because of the missing selection in ExtractSelection
.
A potential solution is not working:
During the search for a solution, I found a post from 2020 where the use of SelectionQuerySource
is proposed as a workaround. The post says to remove
QuerySelect(QueryString='id == 1', FieldType='CELL', InsideOut=0)
and to add
sqs = SelectionQuerySource( ProcessID=-1, QueryString='id==1', HierarchicalIndex=-1, FieldType='POINT', HierarchicalLevel=-1)
extractSelection1.Selection = sqs
Problem:
When I try to execute SelectionQuerySource
with FieldType='POINT'
(or with FieldType='CELL'
), I’m getting an error message saying that SelectionQuerySource
has no attribute FieldType
. In the documentation of SelectionQuerySource
, I see “field type” in the text and an attribute called FieldTypeOption
, but no attribute FieldType
. I tried some variations of the SelectionQuerySource command, but my knowledge of ParaView (and its data structures) is not sufficient to get it to work.
Is there a solution or workaround that allows to save a selection used for ExtractSelection
in a saved state?
Why is FieldType='CELL'
not working anymore for SelectionQuerySource
?
I’m using ParaView 5.11.2 on Windows 11.
Additional information found during the search for a solution:
- Another example (from 2013) where
FieldType='POINT'
is used withSelectionQuerySource
- A Python code snippet allowing to save the state to a .py file. (The
SaveState
command “only” allows to save to a .pvsm file.) Doesn’t help, the selection is also missing in the .py file. - A post and an issue of the possibly related topic of Find Data selections being missed by the trace recorder