Hi there,
I am trying to script some data processing in paraview. Specifically, importing a vti file and using “find data matching various criteria” to find the points which meet my criteria (eg: propertyX <= 0). When I using “Find Data” and run a python trace however, what I see is the following:
# create a new 'Extract Selection'
extractSelection1 = ExtractSelection(Input=dataVTI,
Selection=None)
# show data in view
extractSelection1Display = Show(extractSelection1, renderView1)
# trace defaults for the display properties.
extractSelection1Display.Representation = 'Surface'
extractSelection1Display.ColorArrayName = [None, '']
extractSelection1Display.OSPRayScaleArray = 'geometry'
extractSelection1Display.OSPRayScaleFunction = 'PiecewiseFunction'
extractSelection1Display.SelectOrientationVectors = 'None'
extractSelection1Display.ScaleFactor = 0.21600012183189393
extractSelection1Display.SelectScaleArray = 'None'
extractSelection1Display.GlyphType = 'Arrow'
extractSelection1Display.GlyphTableIndexArray = 'None'
extractSelection1Display.DataAxesGrid = 'GridAxesRepresentation'
extractSelection1Display.PolarAxes = 'PolarAxesRepresentation'
extractSelection1Display.ScalarOpacityUnitDistance = 0.6655801979167395
extractSelection1Display.GaussianRadius = 0.10800006091594697
extractSelection1Display.SetScaleArray = ['POINTS', 'geometry']
extractSelection1Display.ScaleTransferFunction = 'PiecewiseFunction'
extractSelection1Display.OpacityArray = ['POINTS', 'geometry']
extractSelection1Display.OpacityTransferFunction = 'PiecewiseFunction'
# init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
extractSelection1Display.DataAxesGrid.XTitleColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.DataAxesGrid.YTitleColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.DataAxesGrid.ZTitleColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.DataAxesGrid.XLabelColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.DataAxesGrid.YLabelColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.DataAxesGrid.ZLabelColor = [0.3333333333333333, 0.0, 1.0]
# init the 'PolarAxesRepresentation' selected for 'PolarAxes'
extractSelection1Display.PolarAxes.PolarAxisTitleColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.PolarAxes.PolarAxisLabelColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.PolarAxes.LastRadialAxisTextColor = [0.3333333333333333, 0.0, 1.0]
extractSelection1Display.PolarAxes.SecondaryRadialAxesTextColor = [0.3333333333333333, 0.0, 1.0]
# hide data in view
Hide(dataVTI, renderView1)
# update the view to ensure updated data information
renderView1.Update()
I do not see anywhere in the python code where propertyX <= 0 is set. However, in the Properties of the ‘ExtractSelection1’ I see the following:
Type: Query
propertyX <= 0
Elements: Points
The points are correctly extracted. However I can only do this manually, I have not been able to automate this.
Can someone please explain how to create this extractSelection filter to specify the selection from python?
many thanks in advance
Jesse