[vtkusers] python array syntax
David Gobbi
david.gobbi at gmail.com
Sat May 1 21:13:02 EDT 2010
On Sat, May 1, 2010 at 6:34 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I am trying to rename an array:
>
> input = self.GetPolyDataInput();
>
> oldColors = input.GetPointData().GetArray("RGB colors")
> oldColors.SetName("colors")
>
> it says "no attribute SetName"
>
> 2) I want to get a tuple from an array:
>
> oldColors = input.GetPointData().GetArray("RGB colors")
> a = oldColors.GetValue(0);
>
> it says "no attribute GetValue".
>
> Anyone know the correct syntax for either of these?
The syntax is correct. My guess is that there is no array called "RGB
colors". This means that oldColors is being set to None (equivalent
to the C++ NULL).
David
More information about the vtkusers
mailing list