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

**URL:** https://discourse.paraview.org/t/is-there-a-way-to-pass-a-clip-area-to-a-feature-edges-filter/1340
**Category:** ParaView Support
**Tags:** python
**Created:** [February 22, 2019, 5:18pm UTC](https://discourse.paraview.org/t/is-there-a-way-to-pass-a-clip-area-to-a-feature-edges-filter/1340 "2019-02-22T17:18:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![fabio.romani](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/4bbf92/32.png) [@fabio.romani](https://discourse.paraview.org/u/fabio.romani)
#### Post date: [February 22, 2019, 5:18pm UTC](https://discourse.paraview.org/t/is-there-a-way-to-pass-a-clip-area-to-a-feature-edges-filter/1340/1 "2019-02-22T17:18:28Z")

</div>

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()  
’

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 22, 2019, 5:55pm UTC](https://discourse.paraview.org/t/is-there-a-way-to-pass-a-clip-area-to-a-feature-edges-filter/1340/2 "2019-02-22T17:55:12Z")

</div>

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.
