# In Activiz No SetValue and GetValue in vtkCharArray and other Array

**URL:** https://discourse.vtk.org/t/in-activiz-no-setvalue-and-getvalue-in-vtkchararray-and-other-array/15447
**Category:** Support
**Created:** [March 31, 2025, 5:31am UTC](https://discourse.vtk.org/t/in-activiz-no-setvalue-and-getvalue-in-vtkchararray-and-other-array/15447 "2025-03-31T05:31:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![INCREADIBLE](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@INCREADIBLE](https://discourse.vtk.org/u/INCREADIBLE)
#### Post date: [March 31, 2025, 5:31am UTC](https://discourse.vtk.org/t/in-activiz-no-setvalue-and-getvalue-in-vtkchararray-and-other-array/15447/1 "2025-03-31T05:31:11Z")

</div>

Hi  
I am tring to move C++ VTK code to activiz 9.4 ,but meet some problem in vtkIntArray, vtkCharArray, etc. These array seems do not have SetValue and GetValue any more ,and they only have SetTuple and GetTuple to set/get data, and the return value type is double. But the online examples are still use SetValue,i am not sure what is the correct way to set/get data from a array.

---

<div class="post-metadata">

### Author: ![lgivord](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lgivord/32/3543_2.png) [@lgivord](https://discourse.vtk.org/u/lgivord)
#### Post date: [March 31, 2025, 2:06pm UTC](https://discourse.vtk.org/t/in-activiz-no-setvalue-and-getvalue-in-vtkchararray-and-other-array/15447/2 "2025-03-31T14:06:29Z")

</div>

FYI @LucasGandel

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [April 1, 2025, 8:32am UTC](https://discourse.vtk.org/t/in-activiz-no-setvalue-and-getvalue-in-vtkchararray-and-other-array/15447/3 "2025-04-01T08:32:46Z")

</div>

Hi,

I confirm the signatures to set/get typed tuples are missing in Activiz 9.4. We are working on adding this for the next release.  
In the meantime, you can use the signatures accepting `double` when a cast is possible, and use marshalling for other types like `char`.  
The following should help:

```auto
            vtkIntArray intArray = vtkIntArray.New();
            intArray.SetNumberOfComponents(1);
            intArray.SetNumberOfTuples(1);
            intArray.SetTuple1(0, 1);
            Console.WriteLine(intArray.GetTuple1(0));

            vtkCharArray charArray = vtkCharArray.New();
            charArray.SetNumberOfComponents(1);
            charArray.SetNumberOfTuples(3);

            // Set VTK char array
            char[] chars = new char[3] {'v', 't', 'k' };
            GCHandle h_chars = GCHandle.Alloc(chars, GCHandleType.Pinned);
            charArray.SetVoidArray(h_chars.AddrOfPinnedObject(), chars.Length, 1);
            h_chars.Free();

            // Get VTK char array
            char[] out_chars = new char[3];
            Marshal.Copy(charArray.GetVoidPointer(0), out_chars, 0, out_chars.Length);
            Console.WriteLine(out_chars);

```

---

<div class="post-metadata">

### Author: ![INCREADIBLE](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@INCREADIBLE](https://discourse.vtk.org/u/INCREADIBLE)
#### Post date: [April 5, 2025, 10:56am UTC](https://discourse.vtk.org/t/in-activiz-no-setvalue-and-getvalue-in-vtkchararray-and-other-array/15447/4 "2025-04-05T10:56:59Z")

</div>

thanks, and i use cast to convert GetTuple’s return type double to sbyte or int,it works
