---
title: "snapToLocal"
canonical: "https://help.vicon.com/space/Shogun110/13076081/snapToLocal"
format: markdown
---
# Description

Snaps a named node to the position and rotation defined by the local coordinate system of the selected node.

The snapToLocal command differs from [snapToSystem](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076085), [snapToSystemAlign](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076087), and [snapToRigid](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076083) in that snapToLocal only requires one node be selected to define the coordinate system.

## Functional area

Snap

# Command syntax

## Syntax

|  |
| --- |
| `snapToLocal "targetNodeName" offsetX offsetY offsetZ [-allTime] [-positionOnly] [-rotationOnly] [-ranges]` |

### Arguments

> Macro (scroll-tablelayout)

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `zOffset` | float | yes | Specifies the position offset to apply to the object being snapped on the Z axis of the space defined by the selected markers. |
| `yOffset` | float | yes | Specifies the position offset to apply to the object being snapped on the Y axis of the space defined by the selected markers. |
| `xOffset` | float | yes | Specifies the position offset to apply to the object being snapped on the X axis of the space defined by the selected markers. |
| `targetNodeName` | string | yes | Name of the node that will be snapped. |

> Macro (scroll-pagebreak)

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag arguments** | **Argument type** | **Exclusive to** | **Comments** |
| --- | --- | --- | --- | --- |
| `all time` | 0 | — | ranges | Performs the snap over the entire animation range. |
| `positionOnly` | 0 | — | rotationOnly | Only modifies the position of the node being snapped. |
| `rotationOnly` | 0 | — | positionOnly | Only modifies the rotation of the node being snapped. |
| `absolute` | 0 | — | — | Specifies the offset is in mm rather then a percentage of the distance between the first two nodes that define the system. |
| `ranges` | 0 | — | allTime | Performs the snap over the selected time ranges. |

## Return value

void

## Examples

```plaintext
// Create a marker and set its translation and rotation in space 
// then create a second marker and snap it relative to the first
// markers system.
create Marker "marker1";
setProperty Translation 200 0 200 -d ;
setProperty Rotation 0 45 45 -d;
create Marker "marker2";
select marker1;
snapToLocal "marker2" 100 100 100;
```

> Macro (scroll-pagebreak)

# Additional information

## Related commands

- [snapTo](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076075)
- [snapToConstraint](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076077)
- [snapToLine](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076079)
- [snapToRigid](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076083)
- [snapToSystem](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076085)
- [snapToSystemAlign](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13076087)