The problem with your code is that you are connecting a vtk object (the
vtkPlane) directly to a proxy (the Cut filter). To create a plane proxy
refer to Robert's link. Here's the script updated to the current CVS (servermanager.createModule() is now directly accessible):<br>
<br>
<pre>implicit_functions = servermanager.createModule("implicit_functions")<br>plane1 = implicit_functions.Plane()<br>plane1.Normal = [1, 0, 0]<br><br>cutfunc = servermanager.filters.Cut(Input=cube1)<br>cutfunc.CutFunction = plane1<br>
cutfunc.ContourValues = [1.0,2.5]<br></pre>
<br>Utkarsh<br><br><div><span class="gmail_quote">On 2/28/08, <b class="gmail_sendername">Robert Maynard</b> <<a href="mailto:robertjmaynard@gmail.com">robertjmaynard@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is most likely your best bet:<br> <a href="http://public.kitware.com/pipermail/paraview/2008-February/006831.html">http://public.kitware.com/pipermail/paraview/2008-February/006831.html</a><br> <br><br> Kent Eschenberg wrote:<br>
> To make a simple cut it seems like I need the following. I left out<br> > all the rest to make this post as short as possible.<br> ><br> > ==============================================<br> > from paraview import servermanager<br>
> servermanager.Connect()<br> > cutF = servermanager.vtk.vtkPlane()<br> > cut = servermanager.filters.Cut()<br> > cut.CutFunction = cutF<br> > ==============================================<br> ><br> > But here's what pvbatch says. I deleted the path up to the build<br>
> directory (mpi).<br> ><br> > ==============================================<br> > Traceback (most recent call last):<br> > File "t4.py", line 5, in ?<br> > cut.CutFunction = cutF<br> > File "/mpi/Utilities/VTKPythonWrapping/paraview/servermanager.py",<br>
> line 1488, in setProperty<br> > return self.SetPropertyWithName(propName, value)<br> > File "/mpi/Utilities/VTKPythonWrapping/paraview/servermanager.py",<br> > line 163, in SetPropertyWithName<br>
> prop.SetData(arg)<br> > File "/mpi/Utilities/VTKPythonWrapping/paraview/servermanager.py",<br> > line 487, in SetData<br> > self.SMProperty.AddProxy(value_proxy)<br> > TypeError: function takes exactly 2 arguments (1 given)<br>
> ==============================================<br> ><br> > Using 3.2.1 on CentOS 5. Any ideas?<br> ><br> > TIA!<br> > Kent<br> > Pittsburgh Supercomputing Center<br> > _______________________________________________<br>
> ParaView mailing list<br> > <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br> > <a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><br>
_______________________________________________<br> ParaView mailing list<br> <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br> <a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</blockquote></div><br>