[Paraview] SplineSource and python script

Jérôme jerome.velut at gmail.com
Fri Feb 18 05:30:22 EST 2011


Hi,
I have some difficulties to have the SplineSource working properly
through a python script. First, I created a spline by hand and saved
the state as a python file. I simplified it in order to keep only the
SplineSource settings (file attached). When I execute this script
(ParaView-3.10-RC1), I get the following error :

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "/usr/local/lib/paraview-3.10/site-packages/paraview/servermanager.py",
line 207, in __setattr__
    "to add this attribute.")
AttributeError: Attribute Closed does not exist.  This class does not
allow addition of new attributes to avoid mistakes due to typos. Use
add_attribute() if you really want to add this attribute.

When I access the object through python shell, the "Closed" attribute
appears in a protected list (which seems to be the right case) :
>>>> FindSource("RCA").ParametricFunction.__dict__
{'SMProxy': (vtkSMProxy)0x48e25d0, '_Proxy__LastAttrName':
'NewPropertyIterator', '_Proxy__Properties': {'Points': <weakref at
0x4ce6ec0; dead>, 'Closed': <weakref at 0x4ce6158; dead>},
'ObserverTag': -1, 'Observed': None, 'Port': 0}

The same error occurs with the "Points" attribute, thus I cannot add
points by script : this is what I want to do.

Thanks !
Jerome


More information about the ParaView mailing list