Appearance
Types
READ-ONLY reference over the project's building type / assembly system — the Project Properties layer stacks (External / Internal walls, slabs, floors, ceilings, roofs). Accessed via snaptrude.design.types. A type bundles a labelled layer stack — each layer's role, thickness (engine units) and material — plus a summed total thickness. Both the built-in defaults and any team/user-added types are surfaced.
Types are plain value records — NOT scene entities/handles. A type's id is a stable "<kind>:<name>" token (e.g. "wall:exposedConcrete") returned by list and consumed by get. Reads never throw — an unknown id yields null; a kind with no types yields [].
These are reads only: there is no engine seam to author a type from a plugin (types are created through the construction / project-properties UI).
Types
PluginBuildingTypeKind
'wall' | 'slab' | 'floor' | 'ceiling' | 'roof' — the type families.
PluginTypeLayer
One layer of a building type's assembly.
| Property | Type | Description |
|---|---|---|
name | string | Layer name (e.g. "RCC", "Paint") |
role | string | Layer role (e.g. "Structure", "Finish") |
thickness | number | Layer thickness in engine units (project's active unit mode) |
material | object? | Layer material — { name, type } (optional) |
PluginBuildingTypeSummary
A lightweight building-type summary (no layer stack) — returned by list.
| Property | Type | Description |
|---|---|---|
id | string | Stable "<kind>:<name>" token — pass to get |
kind | PluginBuildingTypeKind | Which family it belongs to |
label | string | Human-readable label |
isDefault | boolean | true for a built-in type, false for a team type |
thickness | number | Summed layer thickness in engine units |
PluginBuildingType
A full building type — a PluginBuildingTypeSummary plus its layers: PluginTypeLayer[] stack. Returned by get.
Functions
list(kind)
List the building types of one kind — the built-in defaults plus any team/user-added types. Returns lightweight summaries; call get for the full layer stack.
- Parameters:
kind:PluginBuildingTypeKind— Which family of types to list
- Returns:
PluginBuildingTypeSummary[]— The type summaries ([]when none)
ts
const wallTypes = await snaptrude.design.types.list("wall");
for (const t of wallTypes) console.log(t.id, t.label, t.thickness);get(typeId)
Get one building type by its "<kind>:<name>" id — its labelled layer stack (each layer's role, thickness and material) plus the summed total thickness.
- Parameters:
typeId:string— The type id fromlist(e.g."wall:exposedConcrete")
- Returns:
PluginBuildingType | null— The full type, ornullif no type matches
ts
const [first] = await snaptrude.design.types.list("wall");
const type = await snaptrude.design.types.get(first.id);
if (type) for (const layer of type.layers) console.log(layer.name, layer.role, layer.thickness);Errors
Failed calls reject with a typed PluginError — see Error Handling.
This namespace has no specific error conditions: the reads are total — an unknown or malformed typeId yields null (get), and an empty family yields [] (list). Only a bad-typed kind argument rejects with VALIDATION.