Skip to content

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.

PropertyTypeDescription
namestringLayer name (e.g. "RCC", "Paint")
rolestringLayer role (e.g. "Structure", "Finish")
thicknessnumberLayer thickness in engine units (project's active unit mode)
materialobject?Layer material — { name, type } (optional)

PluginBuildingTypeSummary

A lightweight building-type summary (no layer stack) — returned by list.

PropertyTypeDescription
idstringStable "<kind>:<name>" token — pass to get
kindPluginBuildingTypeKindWhich family it belongs to
labelstringHuman-readable label
isDefaultbooleantrue for a built-in type, false for a team type
thicknessnumberSummed 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 from list (e.g. "wall:exposedConcrete")
  • Returns: PluginBuildingType | null — The full type, or null if 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.