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

# Create a plan view

> Save a floor plan of one storey and get its linework.

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 plan view is a horizontal cut through one storey. You save the storey and the cut height. Floorkit makes the linework from the model each time that you ask for it.

<LiveExample path="guides/create-a-plan-view" />

## Before you start

You have a building model with a storey `ground` that has walls. See [Draw a wall](/floorkit/guides/draw-a-wall).

## Save the view in a project

A project holds the building model, the views and the sheets. This project has one plan view and no sheets.

```typescript theme={null}
import {
  drawProjectView,
  type BuildingModel,
  type ProjectFile,
  type SavedDrawingView,
} from '@opengeometry/floorkit';

export const groundPlan: SavedDrawingView = {
  id: 'ground-plan',
  name: 'Ground floor plan',
  kind: 'plan',
  storeyId: 'ground',
  cutHeightAboveStorey: 1.2,
};

export function createProject(buildingModel: BuildingModel): ProjectFile {
  return {
    schema: 'floorkit.project',
    version: 3,
    buildingModel,
    views: [groundPlan],
    paper: { version: 1, unitSystem: 'metric', sheets: [] },
  };
}
```

## Get the linework

`drawProjectView` returns the drawing as data: lines, arcs, regions and text in metres. Use it to show the plan in your own canvas.

```typescript theme={null}
export function planLinework(project: ProjectFile) {
  const drawing = drawProjectView(project, 'ground-plan');
  console.log(`${drawing.primitives.length} primitives`, drawing.bounds);
  return drawing;
}
```

## Rules

* `cutHeightAboveStorey` is in metres above the storey elevation. A cut at 1.2 metres goes through doors and most windows.
* The view holds no lines. It is drawn from the model, so it is always up to date.
* `showMassing: true` also draws the outline of each part of the mass of every building on the site, on the sheet and in the plan editor. Under the masses it draws the parcel and the dashed setback line: the edge of what the setback check of `evaluateZoning` leaves buildable under the site's zoning rules. Both are drawn only, never selected. It is off by default. A file with this field does not open in Floorkit 1.1.0.
* Give the project the current model of your session before you draw: `{ ...project, buildingModel: session.snapshot() }`.
* To show the plan and let the user edit it, use the [plan editor](/floorkit/guides/add-a-plan-editor).

## Next

<CardGroup cols={2}>
  <Card title="Cut a section" icon="scissors" href="/floorkit/guides/cut-a-section">
    Make a vertical cut through the building.
  </Card>

  <Card title="Compose a sheet" icon="file-lines" href="/floorkit/guides/compose-a-sheet">
    Put this plan on paper.
  </Card>
</CardGroup>


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