Skip to content

equipment ​

Placing parts (equipment, fixtures, devices) by type, and their connectors.

Every example below is a complete script that passes the kit's checks; the kit's tests run each one.

  • equipment.place: Places one part (equipment, a fixture, a device) on a level; its connectors are route ends (placed.connector("supply")).
  • equipment.hostOnWall: Re-hosts existing placed parts flush onto a wall finish face (wall_face host), moving and orienting each part onto the finish face ("nearest" snaps each part to its closest wall) so wall-anchored symbols clear the wall thickness and follow future wall edits.
  • equipment.controlZone: Binds switches (single-pole, 3-way/4-way travelers), 0-10V dimmers, occupancy or daylight sensors to the lighting fixtures or controlled receptacles they govern under one lowercase switch-leg letter ("a", "b"), control wiring protocol ("line_voltage", "0-10v", "dali", "low_voltage", "wireless"), and optional emergency lighting mode ("none", "unswitched", "switched" UL 924).

equipment.place ​

Places one part (equipment, a fixture, a device) on a level; its connectors are route ends (placed.connector("supply")). Pass onWall ({ wall, along?, side?, toward?, offset? } or "nearest") to mount wall-hosted devices flush on the wall finish face with local +Y into the room so annotative symbols stay outside the wall thickness and follow wall edits.

ts
place(ctx: ScriptContext, spec: { level: string; type: string; at?: PlanPoint; height?: Measure; rotationDeg?: number; mark?: string; values?: Record<string, string | number | boolean>; onSlab?: string; onWall?: WallMountSpec | "nearest"; zone?: string; id?: string }): PlacedPart

Topics: place equipment, rooftop unit, rtu, water heater, panel, fixture, device, wall mount, wall host, onWall, receptacle, switch, connect equipment, library part, built-in part

Example script
ts
import { defineScript, units, routes, parts, building, equipment, documents, checks } from "@permitzip/bim-script";
export default defineScript({
  kind: "route",
  reads: { levels: true },
  parameters: {},
  run(ctx) {
    const rtu = equipment.place(ctx, { level: "L1", type: "acme.rtu.10t", at: { x: units.ft(20), y: units.ft(10) }, mark: "RTU-1" });
    routes.along(ctx, { level: "L1", domain: "duct", size: routes.rect(units.in(20), units.in(12)), system: { id: "sa-1", kind: "supply_air" }, from: rtu.connector("supply"), points: [{ x: units.ft(20), y: units.ft(0) }] });
  },
});

equipment.hostOnWall ​

Re-hosts existing placed parts flush onto a wall finish face (wall_face host), moving and orienting each part onto the finish face ("nearest" snaps each part to its closest wall) so wall-anchored symbols clear the wall thickness and follow future wall edits.

ts
hostOnWall(ctx: ScriptContext, partIds: string | readonly string[], onWall?: WallMountSpec | "nearest", opts?: { maxDistance?: Measure }): readonly { partId: string; wallId: string; side: 1 | -1; stationMm: number }[]

Topics: wall host, wall face, rehost, hostOnWall, receptacle, switch, flush on wall, mount on wall

Example script
ts
import { defineScript, units, routes, parts, building, equipment, documents, checks } from "@permitzip/bim-script";
export default defineScript({
  kind: "layout",
  reads: { levels: true },
  parameters: {},
  run(ctx) {
    const w = building.wall(ctx, { level: "L1", from: { x: units.ft(0), y: units.ft(0) }, to: { x: units.ft(20), y: units.ft(0) } });
    const r = equipment.place(ctx, { level: "L1", type: "builtin:duplex-receptacle@1", at: { x: units.ft(6), y: units.ft(0.5) }, height: units.in(18), mark: "R-1" });
    equipment.hostOnWall(ctx, r.id, { wall: w, toward: { x: units.ft(6), y: units.ft(4) } });
  },
});

equipment.controlZone ​

Binds switches (single-pole, 3-way/4-way travelers), 0-10V dimmers, occupancy or daylight sensors to the lighting fixtures or controlled receptacles they govern under one lowercase switch-leg letter ("a", "b"), control wiring protocol ("line_voltage", "0-10v", "dali", "low_voltage", "wireless"), and optional emergency lighting mode ("none", "unswitched", "switched" UL 924).

ts
controlZone(ctx: ScriptContext, spec: { leg: string; controllers: readonly (string | PlacedPart)[]; loads: readonly (string | PlacedPart)[]; protocol?: "line_voltage" | "0-10v" | "dali" | "low_voltage" | "wireless"; emergencyMode?: "none" | "unswitched" | "switched" }): void

Topics: switching, switch leg, 0-10v, dimmer, occupancy sensor, controls, lighting control, controlled receptacle, emergency lighting, ul 924

Example script
ts
import { defineScript, units, routes, parts, building, equipment, documents, checks } from "@permitzip/bim-script";
export default defineScript({
  kind: "layout",
  reads: { levels: true },
  parameters: {},
  run(ctx) {
    const sw = equipment.place(ctx, { level: "L1", type: "builtin:switch-dimmer@1", at: { x: units.ft(2), y: units.ft(0) }, mark: "SD-1" });
    const lt = equipment.place(ctx, { level: "L1", type: "builtin:troffer-2x4-led@1", at: { x: units.ft(8), y: units.ft(8) }, mark: "F1" });
    equipment.controlZone(ctx, { leg: "a", controllers: [sw], loads: [lt], protocol: "0-10v", emergencyMode: "switched" });
  },
});

Apache License 2.0. The reference is generated from the code on every change.