Is there a way to pass a clip area to a feature edges filter

Hi,

I’m trying to cut a box out of a polygon and pass the clip area to a FeatureEdges filter, but what I’m doing doesn’t seem to work. Is it possible? and if so, how?
Here’s my (not working) code:
'python
from paraview.simple import *
import paraview.vtk as vtk

reference /usr/pack/paraview-3.14.1-gm/./paraview-3.14.1-linux-64bit/lib/paraview-3.14/site-packages/paraview/

Importing the vtk file

reader = OpenDataFile("./tm-mag-xyz_slice.vtk")
Show(reader)
SetDisplayProperties(Representation = “Surface”)
SetDisplayProperties(ColorArrayName = “scalars”)
SetDisplayProperties(LookupTable = MakeBlueToRedLT(-100, 1e10))
Render()

collecting shape’s bounds

(xmin, xmax, ymin, ymax, zmin, zmax) = reader.GetDataInformation().GetBounds()

selecting points inside the comb

clipArea = Clip(reader)
clipArea.ClipType = ‘Box’
clipArea.ClipType.Bounds = [xmin, xmax, ymin + 160.0, ymax - 160.0, zmin, zmax]

0 to keep inside, 1 to keep outside

clipArea.InsideOut = 0
clipArea.UpdatePipeline()

finding holes inside the polygon

featureEdges = FeatureEdges(clipArea)

selecting only the holes boundaries

featureEdges.BoundaryEdges = 1
featureEdges.FeatureEdges = 0
featureEdges.NonManifoldEdges = 0
featureEdges.UpdatePipeline()
connectivityFilter = Connectivity(featureEdges)
connectivityFilter.UpdatePipeline()

adding programmable filter to remove false CD channels

programmableFilter = ProgrammableFilter()
programmableFilter.Input = [reader, connectivityFilter]
progrFilterFile = open("./programmable_filter_holes.py")
programmableFilter.Script = progrFilterFile.read()
programmableFilter.UpdatePipeline()
w = CreateWriter("./modified_data.vtk")
w.UpdatePipeline()

That should be possible.

One way to gain insight into issues with Python scripting in ParaView is to perform the actions you want in the ParaView GUI and recording a Python trace. Start a trace by selecting the Tools -> Start Trace menu item. This will record your actions in a Python script, letting you see a script that will reproduce the actions you performed in the user interface. When you are done with your actions, select Tools -> Stop Trace. You will get a script that you can edit that should work.