Skip to content

Program

Program-mode planning APIs — the space-planning layer of the active project: department groupings with area targets, the metrics that track allocated area against those targets, the site/plot context the plan sits in, and the reports that render program and takeoff data to spreadsheet sheets. Accessed via snaptrude.program.

Reads describe the plan (intent + targets); the geometry that realizes the plan is authored through the geometry namespaces. All methods are host API calls that return Promises. Reads never throw for a missing program — they return empty lists and zero totals. Writes (department edits, spreadsheet renders) are enabled by default.

Sub-namespaces

NamespaceWhat it covers
program.departmentsRead and edit program departments — groupings, colors, area targets, space assignment
program.metricsThe area-program summary — total and per-department targets vs allocated area
program.adjacencyThe proximity relationships between departments or spaces — read and compute the matrix
program.areasFAR / built-up-area rollup and groupings
program.spreadsheetRender program/takeoff data to sheets, build and export report workbooks, read them back
program.siteThe site/plot planning context — total area, parcel footprints, geo rings
program.coresVertical-circulation cores — list them and test whether a component is a core
program.classificationThe classification catalog (space/area/mass types) and display tags

Area units

Area-units convention

Every area in this family is reported in square feet ("ft2") or square metres ("m2") — the PluginAreaUnit enum. A result carries exactly one units field, at the top level of the value the method returns: on the response envelope for list/multi/composite results, and on the record itself only for a single .get that returns a bare record. Inner/leaf records never repeat it. See Metrics for the full convention.

End-to-end example

Group the selected spaces into a new department with an area target, check allocation against the target, then render and export the program report.

ts
const selected = await snaptrude.design.selection.get();
if (selected.length === 0) throw new Error("Select the spaces to program first");

// Create a department and move the selected spaces into it
const { departmentId } = await snaptrude.program.departments.create("Bedrooms", "#b5e1dc");
await snaptrude.program.departments.assign(departmentId, selected);
await snaptrude.program.departments.setTargetArea(departmentId, 200, "m2");

// Allocation vs target
const m = await snaptrude.program.metrics.get();
const dept = m.departments.find((d) => d.departmentId === departmentId);
console.log(`Bedrooms: ${dept?.allocatedArea} / ${dept?.targetArea} ${m.units}`);
console.log(`Project: ${m.totalAllocatedArea} / ${m.totalTargetArea} ${m.units}`);

// Render the program report and export the workbook
await snaptrude.program.spreadsheet.renderProgram({ sheetName: "Program", title: "Area Program" });
const file = await snaptrude.program.spreadsheet.export("xlsx", { fileName: "area-program" });
console.log(`Exported ${file.fileName} (${file.mimeType})`);