> ## 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.

# Add a window

> Put a window in a wall at a sill height.

export const LiveExample = ({path, title = 'Live example', height = 460}) => {
  return <Frame>
      <iframe src={`https://floorkit-examples.ploterr.com/floorkit/${path}?embed=1`} ref={frame => {
    if (!frame || !['localhost', '127.0.0.1'].includes(window.location.hostname)) return;
    const local = `http://localhost:5555/${path}?embed=1`;
    if (frame.src !== local) frame.src = local;
  }} title={title} loading="lazy" allow="fullscreen" style={{
    width: '100%',
    height: `${height}px`,
    border: 0,
    display: 'block'
  }} />
    </Frame>;
};

A window belongs to a wall, as a door does. You give its position along the wall, its size and the height of its sill.

<LiveExample path="guides/add-a-window" />

## Before you start

Your building has the room `room-walls` from [Draw a wall](/floorkit/guides/draw-a-wall).

## Add the window

The centre of this window is 4.5 metres from the first point of the wall. The bottom of the glass is 0.9 metres above the base of the wall.

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

export function addWindow(session: BuildingSession): void {
  session.apply(
    {
      kind: 'add-hosted-opening',
      buildingId: 'building',
      storeyId: 'ground',
      wallId: 'room-walls',
      opening: {
        id: 'south-window',
        kind: 'window',
        offset: 4.5,
        width: 1.2,
        height: 1.2,
        sillHeight: 0.9,
      },
    },
    session.revision,
  );
}
```

## Rules

* `offset`, `width`, `height` and `sillHeight` are in metres.
* `sillHeight` is the only vertical control of a window. A window has no `baseHeight`.
* The top of the window, with its frame, must be below the top of the wall.
* The window must not overlap a different opening in the same wall.

## Move or remove the window

A window uses the same commands as a door: `move-hosted-opening` and `remove-hosted-opening`. See [Add a door](/floorkit/guides/add-a-door#move-or-remove-the-door).

## A hole with no window

To cut a plain hole, write a void in the model. A void is an entry in the `openings` of the wall, with `kind: 'void'`, an `offset`, a `width` and a `height`. See [Change the document](/floorkit/guides/start-a-building#change-the-document).

## Next

<CardGroup cols={2}>
  <Card title="Add a floor slab" icon="layer-group" href="/floorkit/guides/add-a-floor-slab">
    Put a floor below the walls.
  </Card>

  <Card title="Window API" icon="code" href="/floorkit/api/architecture/window">
    See each option of a window.
  </Card>
</CardGroup>


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