# VTKinformation with vector values

**URL:** https://discourse.vtk.org/t/vtkinformation-with-vector-values/7965
**Category:** Support
**Created:** [March 3, 2022, 11:39am UTC](https://discourse.vtk.org/t/vtkinformation-with-vector-values/7965 "2022-03-03T11:39:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![naffrancois](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/f08c70/32.png) [@naffrancois](https://discourse.vtk.org/u/naffrancois)
#### Post date: [March 3, 2022, 11:39am UTC](https://discourse.vtk.org/t/vtkinformation-with-vector-values/7965/1 "2022-03-03T11:39:33Z")

</div>

Hello,

Could somebody help me using vtkInformationDoubleVectorKey ? I compiled the example given here: [https://kitware.github.io/vtk-examples/site/Cxx/PolyData/AttachAttributes/](https://kitware.github.io/vtk-examples/site/Cxx/PolyData/AttachAttributes/) , works as expected.

However I do not quite understand the Set function. It looks to me that the number of arguments corresponds to the size of the vector. Is there a way to pass the vector directly ? By the way if I use a size 4 vector, e.g. if I change length to 4 and add values[3] to the argument list of function Set, compilation fails with following message:

error: no matching function for call to ‘vtkInformation::Set(vtkInformationDoubleVectorKey\*&, double&, double&, double&, double&)’

Any help please ?

---

<div class="post-metadata">

### Author: ![naffrancois](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/f08c70/32.png) [@naffrancois](https://discourse.vtk.org/u/naffrancois)
#### Post date: [March 3, 2022, 11:48am UTC](https://discourse.vtk.org/t/vtkinformation-with-vector-values/7965/2 "2022-03-03T11:48:15Z")

</div>

well… sorry. There is indeed a function Set (vtkInformation \*info, const double \*value, int length)

---

<div class="post-metadata">

### Author: ![naffrancois](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/f08c70/32.png) [@naffrancois](https://discourse.vtk.org/u/naffrancois)
#### Post date: [March 3, 2022, 11:57am UTC](https://discourse.vtk.org/t/vtkinformation-with-vector-values/7965/3 "2022-03-03T11:57:24Z")

</div>

This function however does not work for me with Java. I can use append instead but this is not as flexible… Would anyone have a hint or a working example ?
