---
title: "setPosition"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737651/setPosition"
format: markdown
---
# Description

Use setPosition to set the translation of a module in relative or world space coordinates.

setPosition modifies the keys of the current frame. If no animation data exists when setPosition is run, it creates a key.

## Functional area

Data manipulators

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `setPosition "moduleName" posVec [-ws] [-preTrans] [-default]` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `posVec` |  |  | The vector data to apply |
| `moduleName` |  |  | Name of the module you want to modify |

### Flags

> Macro (scroll-tablelayout)

| Name | Flag arguments | Argument type | Exclusive to | Comments |
| --- | --- | --- | --- | --- |
| `ws` | 0 | — | — | PosVector data is applied in world space coordinates |
| `preTrans` | 0 | — | default | — |
| `default` | 0 | — | preTrans | — |

## Return value

void 

> Macro (scroll-pagebreak)

## Examples

```plaintext
//Create a marker and set its position
create Marker "marker1"; 
setPosition marker1 <<100, 0, 0>>;
```

# Additional information

## Related commands

- [setKey](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737949)
- [setRotation](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737306)
- [setScale](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736896)