Skip to content

Entity

Deprecated namespace

snaptrude.entity is deprecated and kept only for backward compatibility. Its members still work, but new plugins should call the canonical homes:

LegacyCanonical home
entity.storycore.storeys
entity.referenceLinereads via design.query.referenceLines; create/update/delete via design.*
entity.buildableEnvelopedesign.create.buildableEnvelope / design.update.buildableEnvelope
entity.space (removed)design.create.space / design.query / design.update / design.delete
entity.department (removed)program.departments

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 — deprecated, use core.storeys

Create, query, and update stories (floors/storeys). Deprecated in favour of core.storeys, whose list() returns a storeys array (the getAll() result with storiesstoreys).

ts
const { storeys } = await snaptrude.core.storeys.list();

Reference Line — deprecated, use design.*

Create, query, and delete reference lines (grid lines and alignment guides). Deprecated — read via design.query.referenceLines; create/update/delete via the design.* reference-line APIs.

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 — deprecated, use design.*

Create or update parametric buildable envelopes from site polygons and zoning constraints. Deprecated — use design.create.buildableEnvelope / design.update.buildableEnvelope.

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
);