> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ploterr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WallTool

> WallTool draws walls point by point into a WallNetwork.

Use it for a click-to-draw tool on live walls.

## Import

```typescript theme={null}
import { WallTool } from '@opengeometry/floorkit';
```

## Example

```typescript theme={null}
import { WallTool, type WallNetwork, type WallOptions } from '@opengeometry/floorkit';

export function drawAxis(network: WallNetwork, options: Omit<WallOptions, 'axis' | 'ogid'>): void {
  const tool = new WallTool(network, options);
  const y = tool.baseElevation;
  tool.add([0, y, 0]);
  tool.add([4, y, 0]);
  tool.move([4, y, 3]);
  tool.add([4, y, 3]);
  const result = tool.finish();
  if (result) {
    result.edit.undo();
    result.edit.redo();
  }
}
```

## Notes

* Points are in metres and must be on the base plane of the tool.
* `add` sets a point. `move` updates the preview. `finish` makes the walls. `cancel` drops the draft.
* `finish()` returns `undefined` when there are too few points.
* For walls that must go into a building session, use [`beginManagedWallCreate`](/floorkit/api/editor/begin-managed-wall-create).

## Constructor

```typescript theme={null}
constructor(network: WallNetwork, options: Omit<WallOptions, 'axis' | 'ogid'>, onCommit?: ((result: WallToolCommit) => void) | undefined, mode?: 'line' | 'arc');
```

<ParamField path="options.height" type="number" required />

<ParamField path="options.color" type="number" required />

<ParamField path="options.propertySets" type="PropertySets" />

<ParamField path="options.labelName" type="string" required />

<ParamField path="options.thickness" type="number" required />

<ParamField path="options.baseElevation" type="number" required />

<ParamField path="options.locationLine" type="LocationLine" required />

<ParamField path="options.locationOffset" type="number" required />

<ParamField path="options.material" type="string" required />

<ParamField path="options.priority" type="number" required />

<ParamField path="options.joins" type="{ start: WallEndJoin; end: WallEndJoin; }" required />

## Properties

<ResponseField name="network" type="WallNetwork">
  Read-only.
</ResponseField>

<ResponseField name="options" type="Omit<WallOptions, 'axis' | 'ogid'>">
  Read-only.
</ResponseField>

<ResponseField name="onCommit" type="((result: WallToolCommit) => void) | undefined">
  Read-only.
</ResponseField>

<ResponseField name="mode" type="'line' | 'arc'">
  Read-only.
</ResponseField>

<ResponseField name="baseElevation" type="number">
  Read-only.
</ResponseField>

<ResponseField name="preview" type="readonly Vec3[]">
  Read-only.
</ResponseField>

<ResponseField name="previewFootprints" type="readonly XZ[][]">
  Read-only.
</ResponseField>

<ResponseField name="previewCurvedFootprints" type="WallFootprint">
  Read-only.
</ResponseField>

<ResponseField name="vertices" type="readonly Vec3[]">
  Read-only.
</ResponseField>

## Methods

### move

```typescript theme={null}
move(point: Vec3): void;
```

### add

```typescript theme={null}
add(point: Vec3, closeTolerance?: number): WallToolCommit | undefined;
```

### finish

```typescript theme={null}
finish(close?: boolean): WallToolCommit | undefined;
```

### removeLast

```typescript theme={null}
removeLast(): void;
```

### cancel

```typescript theme={null}
cancel(): void;
```

## Types

### WallToolCommit

```typescript theme={null}
interface WallToolCommit {
  walls: Wall[];
  edit: {
    undo: () => void;
    redo: () => void;
  };
}
```

## Related

* [`Wall`](/floorkit/api/architecture/wall)
* [`WallNetwork`](/floorkit/api/architecture/wall-network)
* [`Vec3`](/floorkit/api/architecture/wall#vec3)
* [`WallFootprint`](/floorkit/api/architecture/wall#wallfootprint)
* [`WallOptions`](/floorkit/api/architecture/wall#walloptions)
* [`XZ`](/floorkit/api/architecture/wall-network#xz)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.