---
title: "A Construction Canvas drawing as DXF (CQ-* layers) and SVG plan files"
method: POST
path: "/drawing-export"
tags: ["House and canvas"]
---

# A Construction Canvas drawing as DXF (CQ-\* layers) and SVG plan files

`POST /drawing-export`

## Request

- Base URL: `https://api.craftquantities.com/v1`
- URL: `https://api.craftquantities.com/v1/drawing-export`
- Auth: none declared

The drawing as create_drawing takes it; one file per drawn level, by the canvas's own plan painters. A file too large to return inline is rebuilt from the drawing's link.

## Query parameters

- `detail` 'full' | 'summary': full (the default): the whole answer. summary: the result lines, the citation line and the page only — fewer tokens to read.
- `format` 'json' | 'md'

## Request body

- object
  - `house` object: The House Estimator's form: the house drawn as the estimator draws it.
    - `example` string: Start from one of the site's example houses (its slug) in place of the estimator's opening house.
    - `values` object: The form's figures, each length with its unit: length, width, storeyHeight, eaveOverhang, rakeOverhang, slabThickness, footingWidth, footingDepth, trenchDepth, windowWidth, windowHeight, doorWidth, doorHeight ("12 m", "40 ft"); and the counts partitions, windows, outsideDoors, interiorDoors, iceDamEaves. Any left out opens where the page opens it.
    - `storeys` 1 | 2
    - `family` 'wall.framed-exterior' | 'wall.masonry' | 'wall.sip'
    - `selection` object: The exterior wall's build-up choices.
    - `pitch` '4' | '6' | '8' | '10' | '12': Roof pitch, rise in 12.
    - `roofFamily` 'roof.asphalt-shingle' | 'roof.tile-slate'
    - `roofSelection` object
  - `commands` object[]: Drawing commands, in order, on the canvas's blank drawing (one storey; the wall, partition, window and door types). The whole request is at most 64 KiB.
    - `op` 'level' | 'type' | 'wall' | 'opening' | 'room' | 'outline' | 'path' | 'point' | 'beam' | 'stair', required
    - `ref` string: A name by which later commands refer to what this one makes.
    - `name` string: A level's, a type's or a room's name.
    - `level` string: A ref given to an earlier command, or the name of a level or type (the blank drawing has the level "ground" and the types EW-1, IW-1, WN-1, DR-1).
    - `type` string: A ref given to an earlier command, or the name of a level or type (the blank drawing has the level "ground" and the types EW-1, IW-1, WN-1, DR-1).
    - `wall` string: The wall an opening goes in: its ref.
    - `c` string: outline: slab, roof, floor, driveway, patio, deck, landscaping; path: footing, cable, pipe, duct, fence, retaining-wall; point: column, pier, outlet, switch, light, panel, fixture, drain, radiator, register.
    - `kind` 'door' | 'window'
    - `assembly` string: A type's build-up: a canvas assembly id (wall.framed-exterior, roof.asphalt-shingle, slab.on-grade …).
    - `selection` object
    - `thickness` union
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `wastePercent` number
    - `elevation` union
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `height` union
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `from` object: A point on plan, each coordinate a length with its unit.
      - `x` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `y` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `to` object: A point on plan, each coordinate a length with its unit.
      - `x` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `y` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `at` object: A point on plan, each coordinate a length with its unit.
      - `x` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `y` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `offset` union: An opening's centre, measured along its wall from the wall's start.
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `points` object[]
      - `x` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `y` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `closed` boolean
    - `p` object: The component's own properties by id (components/properties.ts): a length with its unit (widthMm, heightMm, sillMm …), a choice's option id, a count, true or false.
    - `finishes` object: A room's, or a driveway's, patio's, deck's, fence's or retaining wall's surface role → finish id, by the planner's ids.
    - `scope` object: Its scope question name → answer, by the planner's ids.
  - `document` object: A Construction Canvas document (schema 1 to the canvas's current), opened and checked by the canvas's own opener.
  - `shapes` object[]: Simple shapes the assistant has read from the reader's words — a room, a deck, a patio, a bed, a path, a fence of legs and turns — compiled into the canvas's own commands. Every length with its unit.
    - `shape` 'room' | 'deck' | 'patio' | 'bed' | 'path' | 'fence', required: room: four exterior walls with doors and windows; deck, patio, bed (planted): a rectangle; path: a paved strip; fence: legs and 90° turns. Anything else is refused.
    - `ref` string: A name a later shape's against uses.
    - `name` string: A room's name.
    - `at` object: The south-west corner (a path's or a fence's start). Left out: the origin.
      - `x` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `y` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `width` union: Along x (east): a room's, deck's, patio's or bed's; a path's width across it.
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `depth` union: Along y (north); for a deck or patio against a side, out from it.
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `length` union: A path's length.
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `heading` 'south' | 'east' | 'north' | 'west': The way a path or a fence's first leg runs (default east).
    - `against` object: A deck, patio or bed against a side of an earlier room or rectangle: centred on it, or from its west or south end by offset.
      - `shape` string, required
      - `side` 'south' | 'east' | 'north' | 'west', required
      - `offset` union
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `doors` object[]
      - `side` 'south' | 'east' | 'north' | 'west', required
      - `offset` union, required: Along the wall from its start: walls run counter-clockwise from the south-west corner.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `exterior` boolean: A door: an outside door (the default) or an inside one.
    - `windows` object[]
      - `side` 'south' | 'east' | 'north' | 'west', required
      - `offset` union, required: Along the wall from its start: walls run counter-clockwise from the south-west corner.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `exterior` boolean: A door: an outside door (the default) or an inside one.
    - `legs` union[]: A fence's straight runs, in order.
      - union
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `turns` string[]: A 90° turn between each two legs.
    - `gates` object[]: Gate openings, by leg (from 1) and offset along it; taken out of the run, the gate itself not counted.
      - `leg` integer, required
      - `offset` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `width` union, required
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `build` 'pavers' | 'concrete': A patio's or path's build: a patio is concrete unless pavers; a path is pavers unless concrete.
    - `finishes` object
    - `scope` object
    - `p` object: The component's own properties: a fence's heightMm, a bed's mulchDepthMm, each length with its unit.
  - `layout` object: Rooms by name, size and which room each stands against, laid out on a grid: shared walls drawn once as partitions, every snap or move reported, and each room checked to close.
    - `grid` union: The grid every figure is snapped to (default 10 mm, or 1/2 in in US units). Each snap that changed a figure is reported.
      - number
      - string
      - object
        - `value` number, required
        - `unit` string
    - `rooms` object[], required
      - `name` string, required: Unique in the layout; openings and later rooms refer to it.
      - `width` union, required: Along x (east), wall centre to wall centre.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `depth` union, required: Along y (north), wall centre to wall centre.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `at` object: Its south-west corner. The first room without at or against is at the origin.
        - `x` union, required
          - number
          - string
          - object
            - `value` number, required
            - `unit` string
        - `y` union, required
          - number
          - string
          - object
            - `value` number, required
            - `unit` string
      - `against` object: Beside a side of an earlier room, sharing that wall.
        - `room` string, required
        - `side` 'south' | 'east' | 'north' | 'west', required
        - `align` 'start' | 'centre' | 'end': Along that side: flush with its west or south end (start, the default), centred, or flush with the other end.
        - `offset` union
          - number
          - string
          - object
            - `value` number, required
            - `unit` string
    - `doors` object[]: Each between two rooms, or in a room's side (an outside door where that side is an exterior wall).
      - `room` string: The room it is in, by name.
      - `side` 'south' | 'east' | 'north' | 'west': The side of that room.
      - `offset` union: Its centre along the side from the side's start (walls counter-clockwise from the south-west corner); left out, the middle.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `between` string[]: A door only: the two rooms it joins, on the wall they share.
      - `width` union: The opening's width; left out, the canvas's default.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
    - `windows` object[]: Each in a room's side, on an exterior wall.
      - `room` string: The room it is in, by name.
      - `side` 'south' | 'east' | 'north' | 'west': The side of that room.
      - `offset` union: Its centre along the side from the side's start (walls counter-clockwise from the south-west corner); left out, the middle.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
      - `between` string[]: A door only: the two rooms it joins, on the wall they share.
      - `width` union: The opening's width; left out, the canvas's default.
        - number
        - string
        - object
          - `value` number, required
          - `unit` string
  - `template` string: A Construction Canvas template's slug (the template index lists them: single-room, deck, two-car-garage …): the drawing its page shows, in the reader's system, with a link that opens it.
  - `variant` string: With template: one of its two "what changes if" variants, by id; a wrong one is refused with the template's own list.
  - `system` 'metric' | 'imperial': The unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
  - `inputUnits` 'base': Send "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
  - `formats` string[]: dxf, svg, ifc (openBIM IFC4: one file for the whole drawing, every level, with quantity sets), or several; left out, dxf and svg.
  - `level` string: One level by its id or name; left out, every level with something on its plan.

## Response `200`

The files, inline where they fit, and the drawing's link.

- union
  - object
    - `engine` object, required
    - `system` 'metric' | 'imperial', required
    - `from` string, required
    - `template` object
    - `levels` object[], required
    - `files` object[], required
      - `level` object
      - `format` 'dxf' | 'svg' | 'ifc', required
      - `filename` string, required
      - `mediaType` string, required
      - `bytes` integer, required
      - `content` string, nullable, required: The file's text.
      - `layers` string[]
      - `note` string
    - `units` string, required
    - `layers` string, required
    - `links` object, required
      - `canvas` string, required
      - `drawing` string, nullable, required
    - `rebuild` string, required
    - `document` object
    - `citation` object, required
      - `author` string, required
      - `title` string, required
      - `version` string, nullable
      - `sourcesChecked` string, nullable
      - `url` string, required
      - `accessDate` string, nullable, required
      - `formats` object, required
        - `plain` string, required
        - `apa` string, required
        - `harvard` string, required
        - `bibtex` string, required
    - `licence` object, required
      - `name` string, required
      - `url` string, required
      - `attribution` string, required
    - `notice` string, required
  - object
    - `detail` 'summary', required
    - `tool` string, required
    - `title` string, required
    - `lines` object[], required: The result lines, as the report's table gives them.
    - `notes` string[], required: What a professional must decide, when to call one, a false-friend warning, that adoption is local: kept in every summary.
    - `citation` string, required: The one citation line, built from the answer's own data.
    - `url` string, nullable, required
    - `open` string, nullable, required
    - `more` string, nullable, required

## Other responses

- `400`: The request was refused; every problem is listed.
- `413`: The request was refused; every problem is listed.
- `422`: The request was refused; every problem is listed.

---

[API](https://skmtc.dev/craftquantities/apis/craft-quantities-engine-api.md) · [All operations](https://skmtc.dev/craftquantities/apis/craft-quantities-engine-api/llms.txt) · [OpenAPI document](https://skmtc.dev/craftquantities/apis/craft-quantities-engine-api/revisions/a69883abc23b?raw)
