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

# Use wall types

> Give walls a build-up of layers, such as brick, insulation, block and plaster.

A wall type is a list of layers, each with a material, a thickness and a function. A wall that names a type takes its thickness from the layers. Floorkit builds one body for each layer, joins the layers of walls that meet, and draws each layer with the hatch of its material.

[Live example](https://floorkit-examples.ploterr.com/floorkit/guides/wall-types?embed=1)

## Before you start

You have a session from [Start a building](https://docs.ploterr.com/floorkit/guides/start-a-building.md).

## Define a type, draw walls with it, change a layer

The type `cavity` has four layers, from the left face of the wall: brick 100 mm, insulation 50 mm, block 150 mm and plaster 15 mm. The walls are 315 mm thick. The first wall makes an L; the second wall meets the first one at a T. Then the insulation goes to 80 mm, in one step: every wall of the type gets thicker.

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

export const cavityWall: BmWallType = {
  name: 'Cavity 315',
  layers: [
    { material: 'BRICK', thickness: 0.1, function: 'finishOutside' },
    { material: 'INSULATION', thickness: 0.05, function: 'thermal' },
    { material: 'BLOCK', thickness: 0.15, function: 'structure' },
    { material: 'PLASTER', thickness: 0.015, function: 'finishInside' },
  ],
};

export function addCavityType(session: BuildingSession): void {
  session.apply(
    { kind: 'add-wall-type', typeId: 'cavity', definition: cavityWall },
    session.revision,
  );
}

export function drawTypedWalls(session: BuildingSession): void {
  const walls: Array<{ id: string; points: [number, number][] }> = [
    {
      id: 'typed-l',
      points: [
        [0, 0],
        [6, 0],
        [6, 4],
      ],
    },
    {
      id: 'typed-t',
      points: [
        [3, 0],
        [3, 4],
      ],
    },
  ];
  for (const { id, points } of walls) {
    session.apply(
      {
        kind: 'create-wall',
        buildingId: 'building',
        storeyId: 'ground',
        wall: { id, points, typeRef: 'cavity' },
      },
      session.revision,
    );
  }
}

export function thickenInsulation(session: BuildingSession): void {
  session.apply(
    {
      kind: 'replace-wall-type',
      typeId: 'cavity',
      definition: {
        ...cavityWall,
        layers: cavityWall.layers.map((layer) =>
          layer.material === 'INSULATION' ? { ...layer, thickness: 0.08 } : layer,
        ),
      },
    },
    session.revision,
  );
}
```

## Rules

* A wall with `typeRef` has no `thickness` and no `material`: the type gives both. A curtain wall takes no wall type: `typeRef` with a `curtain` grid is refused with `curtain-wall-type`. `flipped: true` puts the layers in the other order, from the right face.
* Layers are listed from the left face of the wall, seen from its first point looking along it. The location line and its face stay where they are when a type changes.
* Each layer has a `function`: `structure`, `substrate`, `thermal`, `finishOutside`, `finishInside` or `membrane`. The function gives the join rank on the Revit scale: structure 1, substrate 2, thermal 3, finish outside 4, finish inside 5. `joinRank` from 1 to 5 overrides it.
* Where walls meet, the layer with the lower rank runs through and the higher rank stops at it. A membrane has no rank, never cuts another layer and is 0 thick.
* Two layers of the same material meet with no line, also across a join.
* At a Y, two walls mitre and the third butts.
* Curved walls take a wall type too: each layer follows the arc.
* An edit that makes a layer join impossible is refused with `layer-join-rejected`, and nothing changes. A file that already has such a join opens with a warning, and the wall is drawn as one band.
* `replace-wall-type` refuses new layers that make a door or window stop fitting, with `opening-does-not-fit` and the fit numbers. `remove-wall-type` refuses a type that walls use, with `wall-type-in-use` and the ids of the walls.

## Plans, sections and exports

* The plan and sections draw one strip for each layer, with the hatch of its material. See [Pens and hatches](https://docs.ploterr.com/floorkit/api/drawings/pens-and-hatches.md) for the table.
* The IFC export writes one `IfcMaterialLayerSet` for each straight wall segment, from the left face. A curved segment carries its wall type in the export request, but the IFC service does not write the layers of a curved segment yet. See [IFC](https://docs.ploterr.com/floorkit/api/exports/ifc.md).
* The DXF export writes one `HATCH` for each layer, with a pattern by material.

## Next

> [card] [Draw a wall](https://docs.ploterr.com/floorkit/guides/draw-a-wall.md)
>
> Location lines, joins and curved walls.

> [card] [Add a door](https://docs.ploterr.com/floorkit/guides/add-a-door.md)
>
> Cut a door into a wall.


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