[vtkusers] python array syntax
David Doria
daviddoria+vtk at gmail.com
Sat May 1 20:43:37 EDT 2010
On Sat, May 1, 2010 at 8: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?
>
> Thanks,
>
> David
>
Ah, sorry, my 'input' object was not valid.
SetName was fine.
GetValue should be GetTuple3
I'll put up a couple of basic array operations in Python on the wiki soon.
David
More information about the vtkusers
mailing list