ArchLang Playground

Resizable Flat (knobs) — an ArchLang floor plan example

A one-bedroom flat sized by three numbers at its top: change one and the walls, doors, fixtures and dimensions follow.

This plan compiles to 4 rooms, 58.5 m² of floor area and 3 windows; every room is reachable from the entrance.

Living / Kitchen 24.3 m² Bedroom 17.8 m² Entry 9.5 m² Bath 6.9 m² 1900 900 3150 600 1450 4500 3300 8000 5400 2100 7700 1450 1800 2400 1200 1150 4500 3300 8000 100 200 N 02 m PROJECTOne-Bed Flat (resizable)DRAWN BYArchLangDATE2026-11-06
"One-Bed Flat (resizable)" — a 4-room floor plan, 58.5 m² total: Living / Kitchen (24.3 m²), Bedroom (17.82 m²), Entry (9.45 m²), Bath (6.93 m²); 3 doors, 3 windows, entrance via d_front.
Open in the editor

What this plan uses

The parts of the language this plan's source writes, each linked to its section of the language reference.

The source

This is the whole plan. The drawing above is what the compiler produced from it — nothing was drawn by hand.

# A one-bed flat you can resize: three numbers at the top size the whole plan.
#
# The rooms are sized from the three `let`s and placed by relation (`right-of`,
# `below`), `walls from rooms` derives the shell and the partitions from them, every
# opening is hosted by the rooms it joins, and every fixture is anchored to its room.
# So a change to any of the three numbers moves the walls, the doors, the windows, the
# furniture and the dimensions with it, and nothing needs editing by hand. In the
# playground each `let` is a slider.
plan "One-Bed Flat (resizable)" {
  units mm
  grid 50
  north up
  dims auto all

  let LIVING = 4500    # living room width
  let BEDROOM = 3300   # bedroom width
  let DEPTH = 5400     # living and bedroom depth

  room id=r_live at (0,0) size LIVING x DEPTH label "Living / Kitchen" uses living kitchen
  room id=r_bed  right-of r_live align top gap 0 size BEDROOM x DEPTH label "Bedroom" uses bedroom
  room id=r_hall below r_live align left gap 0 size LIVING x 2100 label "Entry" uses hall
  room id=r_bath right-of r_hall align top gap 0 size BEDROOM x 2100 label "Bath" uses bath

  # The entry runs into the living room with no leaf: an opening across the whole edge.
  walls from rooms exterior 200 partition 100 { open between r_hall and r_live }

  door id=d_front on r_hall.bottom at center width 900 hinge near start swing into r_hall
  door between r_live and r_bed  at 900 from end width 800 hinge near end swing into r_bed
  door between r_hall and r_bath at 900 from start width 800 hinge near start swing into r_bath

  window on r_live.top width 1800
  window on r_bed.top  width 1200
  window on r_bath.bottom width 600

  furniture counter      against r_live.left offset 400  size 600x600
  furniture stove        against r_live.left offset 1000 size 600x600
  furniture kitchen_sink against r_live.left offset 1800 size 800x600
  furniture sofa         in r_live anchor top-right flush size 800x1600 label "Sofa"
  furniture bed          in r_bed  anchor top-right flush size 1400x2000 label "Bed"
  furniture shower       in r_bath anchor top-right flush size 900x900
  furniture wc           against r_bath.bottom offset 1500 size 400x700
  furniture basin        against r_bath.bottom offset 600 size 600x450

  title { project "One-Bed Flat (resizable)" drawn_by "ArchLang" date "2026-11-06" }
}

More in Scripting & composition

Read more