<div dir="ltr">Dear Cory,<div><br></div><div>Thank you for your help. </div><div>In my case, this does not work and I get the following error message:</div><div><p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)">Traceback (most recent call last):</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)"> File "<string>", line 22, in <module></span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)"> File "<string>", line 12, in RequestData</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(128,0,0)">TypeError: SetInputData argument 1: method requires a VTK object</span></p></div><div><br></div><div>Maybe it is related to the fact that when I create the first programmable filter, I get this error message:</div><div><img src="cid:ii_15e36fb5bc848912" alt="Inline image 1" width="474" height="257"><br></div><div><br></div><div>I use Paraview 5.4.1 on windows (I get the same behavior with Paraview 5.3.0)</div><div><br></div><div>Best regards,</div><div><br></div><div>Xavier</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 30, 2017 at 7:38 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This works for me in 5.4.1:<br>
<br>
import vtk<br>
<br>
plane = vtk.vtkPlane()<br>
plane.SetOrigin(0, 0, 0)<br>
plane.SetNormal(0, 1, 0)<br>
<br>
clip = vtk.vtkClipDataSet()<br>
clip.SetClipFunction(plane)<br>
clip.SetInputData(self.<wbr>GetInput())<br>
clip.Update()<br>
<br>
self.GetOutput().DeepCopy(<wbr>clip.GetOutput())<br>
<br>
Make sure you set the "Output Data Set Type" to "vtkUnstructuredGrid"<br>
before you first hit Apply. I believe there is a bug that does not let<br>
you change the output data set type after you first click Apply.<br>
<br>
HTH,<br>
Cory<br>
<div><div class="h5"><br>
On Wed, Aug 30, 2017 at 10:27 AM, Xavier Garnaud <<a href="mailto:xgarnaud@gmail.com">xgarnaud@gmail.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I'd like to use the vtkClipDataSet in a programmable filter, but I can't<br>
> find it it paraview.vtk, and the function from vtk does not seem to work. (I<br>
> am using Paraview 5.2 or 5.4 on windows).<br>
> Is the function available, or is there another way to perform the clip?<br>
><br>
> Best regards,<br>
><br>
> Xavier<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/<wbr>ParaView</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<br>
</font></span></blockquote></div><br></div>