Skip to content

Design

Author, query & edit BIM geometry. Accessed via snaptrude.design.

Most functionality lives in the sub-namespaces below. The lock-state verbs (lock / unlock / isLocked / listLocked) and the area-lock verbs (lockArea / unlockArea / isAreaLocked / listAreaLocked) are top-level design methods.

Sub-namespaces

NamespacePageDescription
design.createDesign CreateAuthor new scene-committed BIM entities
design.queryDesign QueryRead-only enumeration and inspection of scene entities and their geometry
design.selectionDesign SelectionRead and mutate the current scene selection
design.transformTransformRigid transforms — move / rotate scene entities
design.updateDesign UpdateEdit existing scene entities — properties and geometry
design.editDesign EditNon-create geometry edits (offset / split a top profile)
design.doorsDoorsDoor-specific reads and edits
design.windowsWindowsWindow-specific reads and dimension mutations
design.furnitureFurniturePlaceable furniture catalog reads (library items, not scene entities)
design.materialsMaterialsProject material library + material assignment
design.eraseErasePlan-level adjacency-edge erase (NOT hard delete)
design.deleteDesign DeleteHard entity removal
design.booleanBoolean OperationsCSG boolean ops (union / subtract / intersect)

Types

PluginDesignChangeResult

Shared result for scene-state change mutations (lock/unlock, selection, visibility) — echoes the handles actually affected (post-cascade for lock). Errors throw (the RPC call rejects); there is no Result<> wrapper in the SDK.

PropertyTypeDescription
affectedComponentHandle[]The entities actually affected by the mutation

PluginDesignLockArgs

Wire-schema for lock arguments.

PropertyTypeDescription
componentsComponentHandle[]Entities to lock

PluginDesignUnlockArgs

Wire-schema for unlock arguments. Same shape as PluginDesignLockArgs.

PropertyTypeDescription
componentsComponentHandle[]Entities to unlock

PluginDesignIsLockedArgs

Wire-schema for isLocked arguments.

PropertyTypeDescription
componentComponentHandleThe entity to test
includeInheritedboolean (optional, default true)Fold group + bucket lock; false reads the own flag only

BooleanOutcome

Result of a CSG boolean op (design.boolean.union / subtract / intersect) — see Boolean Operations. created are the result masses; deleted is every consumed input (for subtract this includes BOTH the target AND the tools). Errors throw (the RPC call rejects).

PropertyTypeDescription
createdComponentHandle[]The result masses
deletedComponentHandle[]Every consumed input component

Functions

lock(components)

Lock entities (blocks editing). Undoable. Cascades to void/door/window children, stacked-wall companions, and terrain neighborhood; skips active-group members.

  • Parameters:
    • components: ComponentHandle[] — Entities to lock
  • Returns: PluginDesignChangeResult — The affected entities (post-cascade)
ts
// Lock a wall, check its state, then release everything the lock touched
const walls = await snaptrude.design.query.listWalls();
const { affected } = await snaptrude.design.lock([walls[0]]);
const locked = await snaptrude.design.isLocked(walls[0]); // true
await snaptrude.design.unlock(affected);

unlock(components)

Unlock entities. Undoable. Paired with lock.

  • Parameters:
    • components: ComponentHandle[] — Entities to unlock
  • Returns: PluginDesignChangeResult — The affected entities

isLocked(component, includeInherited?)

Test whether an entity is locked (folds group + bucket lock unless includeInherited: false).

  • Parameters:
    • component: ComponentHandle — The entity to test
    • includeInherited: boolean (optional, default true) — Fold group + bucket lock; false reads the own flag only
  • Returns: booleantrue if locked, otherwise false

listLocked()

List the explicitly-locked entities (excludes purely group/bucket-inherited locks).

  • Returns: ComponentHandle[] — The locked entities
ts
const locked = await snaptrude.design.listLocked();

lockArea(spaces)

Lock the footprint area of Room/Department mass spaces (distinct from lock, which freezes the whole object). Cascades to instances + source; undoable. Split-gated behind the area_lock treatment — writes throw "Area lock is not enabled" when the treatment is off.

  • Parameters:
    • spaces: ComponentHandle[] — Area-lockable spaces (Room/Department masses)
  • Returns: PluginDesignChangeResult — The affected spaces
  • Throws: when the treatment is off, or any handle is not an area-lockable space
ts
const [space] = await snaptrude.design.query.listMasses();
await snaptrude.design.lockArea([space]);

unlockArea(spaces)

Unlock the footprint area of previously area-locked spaces. Paired with lockArea.

  • Parameters:
    • spaces: ComponentHandle[] — Spaces to area-unlock
  • Returns: PluginDesignChangeResult — The affected spaces

isAreaLocked(space)

Test whether a space's footprint area is locked. Read — never throws (returns false for a non-space or when the treatment is off).

  • Parameters:
    • space: ComponentHandle — The space to test
  • Returns: boolean

listAreaLocked()

List the spaces whose footprint area is locked. Read — returns [] when the treatment is off.

  • Returns: ComponentHandle[] — The area-locked spaces