# how to use getOrientation() / setOrientation(), returning \[undefined\]

**URL:** https://discourse.vtk.org/t/how-to-use-getorientation-setorientation-returning-undefined/6612
**Category:** Support
**Created:** [September 11, 2021, 7:08pm UTC](https://discourse.vtk.org/t/how-to-use-getorientation-setorientation-returning-undefined/6612 "2021-09-11T19:08:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shanebenlolo](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3da27b/32.png) [@shanebenlolo](https://discourse.vtk.org/u/shanebenlolo)
#### Post date: [September 11, 2021, 7:08pm UTC](https://discourse.vtk.org/t/how-to-use-getorientation-setorientation-returning-undefined/6612/1 "2021-09-11T19:08:28Z")

</div>

Hello,

I am trying to rotate my 3d volume. I have already implemented a function which repositions the volume using the following code:

```auto
  shiftX({ layer, value }) {
      apis.forEach(api => {
        const currentPosition = api.volumes[layer].getPosition()
        api.volumes[layer].setPosition(
          (value),
          currentPosition[1],
          currentPosition[2])
        const renderWindow = api.genericRenderWindow.getRenderWindow();
        renderWindow.render()
      })
    },

```

As you can see, I use `getPosition()` and it works perfectly well in this scenario. However, when I do the same for roation like so:

```auto
    rotateX({ layer, value }) {
      apis.forEach(api => {
        const currentOrientation = api.volumes[layer].getOrientation()
        api.volumes[layer].setOrientation(
          (value),
          currentOrientation[1],
          currentOrientation[2])
        const renderWindow = api.genericRenderWindow.getRenderWindow();
        renderWindow.render()
      })
    },

```

I recieve an error saying that the value of `currentOrientation` is `[undefined]`. If I try running

```auto
console.log(api.volumes[layer].getOrientation())

```

I recieve a value of `[undefined]`. Thanks for any help you can offer
