Skip to content

Areas

The FAR / built-up-area rollup for the active program. Accessed via snaptrude.program.areas.

This is the zoning-compliance lens on the model: carpet / built-up / excluded area totals, the site area, and the achieved-vs-target FAR (Floor Area Ratio), plus groupings of those totals. It complements snaptrude.program.metrics (the department-allocation lens).

achievedFar is derived and read-only — computed from built-up area and site area. targetFar is the goal you set (via update); the two are the same ratio, one measured and one intended. The surface speaks FAR only — there is no FSI alias. All area figures are already in the program's display unit (ft2/m2).

Reads never throw. The engine recomputes the breakdown live only while the Area sidebar is open, so a plugin running headless should call refresh() first to guarantee get/list/listMembers are fresh. update is a non-undoable settings write persisted with the project.

Design options: when a design option (proposal) is active, the FAR inputs (target FAR, site area override, deviation) are scoped to that option — each option keeps its own set, exactly like the product's Area settings dialog. update writes the active option's settings and the summary reads (get / refresh / update's returned summary) report that same scope. Without design options there is a single project-wide set.

At a glance

MethodWhat it doesMutates?
get()The whole-program area / FAR summary
list(groupBy, categoryId?)Area totals grouped by storey, building, or tag
listMembers(groupBy, groupId, categoryId?)The spaces behind one group's total
refresh()Recompute the breakdown on demand, return summary— (recompute)
update(options?)Set FAR inputs — target FAR, site area, deviation✓ (not undoable)

Types

PluginProgramAreaSummary

The whole-program area / FAR summary. All area figures are in areaUnit; ratios are unitless.

PropertyTypeDescription
countnumberNumber of spaces in the program (a count, not an area)
hiddenCountnumberNumber of those spaces currently hidden
carpetnumberTotal carpet area in areaUnit
builtUpnumberTotal built-up area in areaUnit
excludednumberTotal excluded area in areaUnit
farBuiltUpnumberBuilt-up area that counts toward FAR, in areaUnit
siteAreanumberSite/plot area in areaUnit
achievedFarnumber | nullDerived FAR (farBuiltUp / siteArea); null when site area or target FAR is unset
targetFarnumberThe target FAR goal (set via update)
deviationnumberAllowed FAR deviation, as a percentage
areaUnit"ft2" | "m2"The unit every area figure above is reported in

PluginProgramAreaGroup

One bucket of the area rollup. Area figures are in the program's area unit; targetArea is in targetUnit.

PropertyTypeDescription
groupIdstringStable id of the group (e.g. storey id, department id)
namestringDisplay name of the group
colorstringCSS hex color for the group (empty for facets that have no color, e.g. storeys/buildings)
carpetnumberCarpet area for this group
builtUpnumberBuilt-up area for this group
excludednumberExcluded area for this group
countnumberNumber of spaces in this group
targetAreanumberTarget area for this group, in targetUnit (labels, departments, and tagCategories carry native targets; storeys/buildings have none, so 0)
targetUnit"ft2" | "m2"The unit targetArea is reported in

PluginProgramAreaMember

A single space within an area group. Area figures are in the program's area unit.

PropertyTypeDescription
idComponentHandleComponent.id of the space (never a mesh handle)
labelstringDisplay label of the space
areaClassPluginAreaClassEffective area class — "NET" (→ carpet), "GROSS" (→ builtUp), or "EXCLUDED" (→ excluded)
carpetnumberCarpet area of the space
builtUpnumberBuilt-up area of the space
excludednumberExcluded area of the space
isVisiblebooleanWhether the space is currently visible

PluginProgramAreaGroupBy

The facet to group the area rollup by: "labels" | "storeys" | "buildings" | "departments" | "tagCategories".

Functions

get()

Get the program area summary — the whole-program totals plus achieved vs target FAR and the area unit they're reported in.

  • Returns: PluginProgramAreaSummaryachievedFar is null when the site area or target FAR is not set.
ts
const s = await snaptrude.program.areas.get();
console.log(s.builtUp, s.siteArea, s.achievedFar, s.targetFar, s.areaUnit);

list(groupBy, categoryId?)

List the program area rollup grouped by a facet — by label, storey, building, department, or tag category.

  • Parameters:
    • groupBy: PluginProgramAreaGroupBy — the facet to group by
    • categoryId: string | undefined — the tag category to group by (required when groupBy is "tagCategories")
  • Returns: { groups: PluginProgramAreaGroup[] } — empty when the program has no spaces.
  • Throws: If groupBy is "tagCategories" and categoryId is omitted.
ts
const { groups } = await snaptrude.program.areas.list("storeys");
for (const g of groups) console.log(g.name, g.builtUp, g.count);

listMembers(groupBy, groupId, categoryId?)

List the spaces that make up one area group, with their per-space area figures.

  • Parameters:
    • groupBy: PluginProgramAreaGroupBy — the same facet used to produce the group
    • groupId: string — the id of the group to expand
    • categoryId: string | undefined — the tag category context (required when groupBy is "tagCategories")
  • Returns: { members: PluginProgramAreaMember[] } — empty when the group is missing or empty.
ts
const { members } = await snaptrude.program.areas.listMembers("storeys", "st_2");
for (const m of members) console.log(m.label, m.carpet);

refresh()

Force the area breakdown to recompute, then return the fresh summary. The engine recomputes carpet / built-up / FAR totals live only while the Area sidebar is open — a plugin running headless can otherwise read a stale (or never-computed) snapshot from get/list/listMembers. Calling refresh drives the same native recompute on demand, so those reads then reflect the current model. This is a read (no write gate): it recomputes derived totals, it does not change the model.

Cost: a full pass over every space, floor, and mass in the active structure. Not free on large models — call it once before a batch of reads, not per read.

  • Returns: PluginProgramAreaSummary — the freshly-recomputed summary.
ts
const s = await snaptrude.program.areas.refresh();
const { groups } = await snaptrude.program.areas.list("storeys"); // now fresh
console.log(s.builtUp, groups.length);

update(options?)

A sparse update of the program-level FAR inputs — target FAR, site area, and allowed deviation. This is a non-undoable settings write (persisted with the project); achievedFar recomputes from these. The geometry totals are untouched.

With an active design option the write lands in that option's settings (the only scope the engine reads while an option is active) — switching options switches the FAR inputs with them. Setting siteArea marks the site area as user-overridden for that scope (the auto-computed site area is used otherwise).

  • Parameters:
    • options.targetFar: number | undefined — new target FAR (≥ 0)
    • options.siteArea: number | undefined — site-area override (> 0), in the program's area unit
    • options.deviation: number | undefined — allowed FAR deviation percentage (0–100)
  • Returns: PluginProgramAreaSummary — the recomputed summary.
  • Throws: If a value is out of range.
ts
const s = await snaptrude.program.areas.update({ targetFar: 2.5 });
console.log(s.achievedFar, s.targetFar);

Errors

Failed calls reject with a typed PluginError — see Error Handling. Conditions specific to this namespace:

CodeThrown byWhendetails
VALIDATIONlist, listMembersgroupBy is "tagCategories" but categoryId is omittedissues

Reads are otherwise total: an unknown groupId in listMembers returns an empty members array, and get/list never throw for an empty program. update has no namespace-specific failure beyond argument validation (out-of-range values are VALIDATION).