Hi Jerome,<br><br>It looks like the ParametricFunction property of the SplineSource is not python friendly. I can confirm this bug. As a workaround, you can do this:<br><br>s.ParametricFunction.SetPropertyWithName("Closed", 1)<br>
s.ParametricFunction.SetPropertyWithName("Points", [x,y,z, x2,y2,z2])<br><br>I think paraview will print an error message when you said the Points property even though it works. You'll see an error message that the spline must contain at least 1 point. My guess is that it clears the Points property before setting the new value.<br>
<br>Pat<br><br><div class="gmail_quote">On Fri, Feb 18, 2011 at 5:30 AM, Jérôme <span dir="ltr"><<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
I have some difficulties to have the SplineSource working properly<br>
through a python script. First, I created a spline by hand and saved<br>
the state as a python file. I simplified it in order to keep only the<br>
SplineSource settings (file attached). When I execute this script<br>
(ParaView-3.10-RC1), I get the following error :<br>
<br>
Traceback (most recent call last):<br>
File "<string>", line 6, in <module><br>
File "/usr/local/lib/paraview-3.10/site-packages/paraview/servermanager.py",<br>
line 207, in __setattr__<br>
"to add this attribute.")<br>
AttributeError: Attribute Closed does not exist. This class does not<br>
allow addition of new attributes to avoid mistakes due to typos. Use<br>
add_attribute() if you really want to add this attribute.<br>
<br>
When I access the object through python shell, the "Closed" attribute<br>
appears in a protected list (which seems to be the right case) :<br>
>>>> FindSource("RCA").ParametricFunction.__dict__<br>
{'SMProxy': (vtkSMProxy)0x48e25d0, '_Proxy__LastAttrName':<br>
'NewPropertyIterator', '_Proxy__Properties': {'Points': <weakref at<br>
0x4ce6ec0; dead>, 'Closed': <weakref at 0x4ce6158; dead>},<br>
'ObserverTag': -1, 'Observed': None, 'Port': 0}<br>
<br>
The same error occurs with the "Points" attribute, thus I cannot add<br>
points by script : this is what I want to do.<br>
<br>
Thanks !<br>
Jerome<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</blockquote></div><br>