Cannot set Scalars attribute properly in Threshold when using python script

Hello Paraview team,

My pipeline contains a “Threshold” to subselect cells based on ‘vtkValidPointMask’ scalar. It works fine when built from the GUI. However, when the pipeline is built from a Python script, the Scalar is not set properly: the Scalars field remains empty as illustrated in the picture. What shall I do to set this attribute properly? All other attributes in the script are set properly.

Best regards

It is because the widget shows only existing arrays. But, as the pipeline didn’t run yet, no arrays are found.

You should add UpdatePipeline() before creating the Threshold.

1 Like

The UpdatePipeline was indeed not placed before the Threshold creation, thank you very much for the solution