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

Positions the given node along the line formed by two selected nodes.

With two nodes that define a line select, snapToLine positions the targetNodeName along that line. The distance along the line is specified as a percentage of the distance between the two nodes making up the line unless the `-absolute` option is used. When `-absolute` is used, the distance along the line is specified in mm.

## Functional area

Snap

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `snapToLine "targetNodeName" %s [-allTime] [-absolute] [-ranges]` |

### Arguments

> Macro (scroll-tablelayout)

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `targetNodeName` | string | yes | Specifies the name of the node to be snapped. |
| `%s` | float | yes | Specifies distance along the line the node should be snapped to. |

> Macro (scroll-pagebreak)

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag arguments** | **Argument type** | **Exclusive to** | **Comments** |
| --- | --- | --- | --- | --- |
| `allTime` | 0 | — | ranges | Performs the snap over the entire animation range. |
| `absolute` | 0 | — | — | Specifies the argument is in mm rather then a percentage of the distance between the two nodes that define the line. |
| `ranges` | 0 | — | allTime | Performs the snap over the selected time ranges. |

## Return value

void

## Examples

```plaintext
// Snap LMWT half way between LFWT and LBWT at the current frame only.
select LFWT LBWT;
snapToLine LMWT 0.5;
```

# Additional information

## Related commands

- [snapTo](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737795)
- [snapToConstraint](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736474)
- [snapToLocal](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736854)
- [snapToRigid](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737073)
- [snapToSystem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737770)
- [snapToSystemAlign](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737280)