[vtkusers] [Python+vtk] Attaching user data to a vtkobject

Eric Boix frog at creatis.insa-lyon.fr
Wed Jan 24 12:11:18 EST 2001


        Dear vtk+Python users,

When using Python I try the following :
   QuadActor = vtkActor()
   QuadActor.myuserdata = "junk"
I get the following message (on the last above line) :
   TypeError: object has read-only attributes

This is probably due to the fact that the Python type of
QuadActor is <type 'vtkobject'> (as opposed to <type 'instance'>)
and hence has NO __dict__ attribute.

What is then the natural way of attaching some user data to a 'vtkobject'
at the Python level ?
(I'm seeking a mecanism close to the Tcl/Tk bindtags and I naively thought
that Python dynamic typing was a straightforward way of doing that...)
  
Yours,
Eric Boix.

----
Eric.Boix at creatis.insa-lyon.fr
http://www.creatis.insa-lyon.fr/~frog





More information about the vtkusers mailing list