Skip to content

Entity

CRUD operations on Snaptrude building entities. Accessed via snaptrude.entity.

All entity methods are host API calls that return Promises; mutating operations support undo/redo via Snaptrude's command system.

Modules

Space (moved)

Space operations moved to the design family — create via design.create.space / design.create.spaces (build a rectangular footprint with core.geom.create.profileRect), update via design.update, read via design.query, delete via design.delete.

ts
const rect = await snaptrude.core.geom.create.profileRect(5, 4);
const contour = await snaptrude.core.geom.create.contourFromProfile(rect);
const spaceId = await snaptrude.design.create.space(contour, 3);

Story

Create, query, and update stories (floors/storeys).

ts
const { stories } = await snaptrude.entity.story.getAll();

Reference Line

Create, query, and delete reference lines (grid lines and alignment guides).

ts
const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll();

Department (moved)

Departments moved to the program family — see Program → Departments.

ts
const { departments } = await snaptrude.program.departments.list();

Buildable Envelope

Create or update parametric buildable envelopes from site polygons and zoning constraints.

ts
const { buildableEnvelopeId } = await snaptrude.entity.buildableEnvelope.create(
  [
    { x: 0, z: 0 },
    { x: 100, z: 0 },
    { x: 100, z: 80 },
    { x: 0, z: 80 }
  ],
  "ft",
  [{ aboveHeight: 0, front: 10, side: 5, rear: 10 }],
  { kind: "max_height", maxHeight: 150 },
  12
);