# Add Segment (`geometry.addSegment`)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/commands/geometry-addSegment/)

**Menu:** none (Quick Open, the CLI, Python and MCP) · **Runs as:** at once

> Preview: turn on Preview features in Edit › Preferences › Simulation, or run `preview.set {"enabled":true}`. Its replies carry `preview: true` and a note.

## What it does

Adds the straight segment; points given by coordinates are added or reused, and the same segment is reused. One undo step.

## Parameters

- `from`: int|\[number\] (a point index, or x, y in m)
- `to`: int|\[number\]
- `snap`: number? (grid, m)

## Reply

- edge (its index)
- from
- to (point indices)
- ...summary
