@snaptrude/plugin-core 0.0.0-dev-20260908074328 → 0.0.0-dev-20260921132444

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +52 -16
  3. package/dist/api/core/io/import/index.d.ts +3 -1
  4. package/dist/api/core/io/import/index.d.ts.map +1 -1
  5. package/dist/api/core/mode/index.d.ts +19 -7
  6. package/dist/api/core/mode/index.d.ts.map +1 -1
  7. package/dist/api/core/tags.d.ts +81 -0
  8. package/dist/api/core/tags.d.ts.map +1 -1
  9. package/dist/api/design/create/bulk-items.d.ts +185 -0
  10. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  11. package/dist/api/design/create/grids.d.ts +132 -0
  12. package/dist/api/design/create/grids.d.ts.map +1 -0
  13. package/dist/api/design/create/index.d.ts +424 -51
  14. package/dist/api/design/create/index.d.ts.map +1 -1
  15. package/dist/api/design/create/opening-fields.d.ts +37 -0
  16. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  17. package/dist/api/design/delete/index.d.ts +6 -20
  18. package/dist/api/design/delete/index.d.ts.map +1 -1
  19. package/dist/api/design/dimensions.d.ts +427 -0
  20. package/dist/api/design/dimensions.d.ts.map +1 -0
  21. package/dist/api/design/doors/index.d.ts +20 -13
  22. package/dist/api/design/doors/index.d.ts.map +1 -1
  23. package/dist/api/design/family.d.ts +73 -5
  24. package/dist/api/design/family.d.ts.map +1 -1
  25. package/dist/api/design/grids.d.ts +237 -0
  26. package/dist/api/design/grids.d.ts.map +1 -0
  27. package/dist/api/design/index.d.ts +9 -0
  28. package/dist/api/design/index.d.ts.map +1 -1
  29. package/dist/api/design/query/grids.d.ts +287 -0
  30. package/dist/api/design/query/grids.d.ts.map +1 -0
  31. package/dist/api/design/query/index.d.ts +29 -2
  32. package/dist/api/design/query/index.d.ts.map +1 -1
  33. package/dist/api/design/query/spaces.d.ts +0 -61
  34. package/dist/api/design/query/spaces.d.ts.map +1 -1
  35. package/dist/api/design/update/index.d.ts +74 -0
  36. package/dist/api/design/update/index.d.ts.map +1 -1
  37. package/dist/api/entity/space.d.ts +0 -3
  38. package/dist/api/entity/space.d.ts.map +1 -1
  39. package/dist/api/presentation/annotate.d.ts +2 -2
  40. package/dist/api/presentation/placedViews.d.ts +1 -35
  41. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  42. package/dist/api/presentation/shapes.d.ts +2 -2
  43. package/dist/api/presentation/sheets.d.ts +2 -20
  44. package/dist/api/presentation/sheets.d.ts.map +1 -1
  45. package/dist/api/program/departments.d.ts +58 -2
  46. package/dist/api/program/departments.d.ts.map +1 -1
  47. package/dist/api/program/index.d.ts +16 -6
  48. package/dist/api/program/index.d.ts.map +1 -1
  49. package/dist/api/program/labels.d.ts +355 -0
  50. package/dist/api/program/labels.d.ts.map +1 -0
  51. package/dist/api/program/metadata.d.ts +328 -0
  52. package/dist/api/program/metadata.d.ts.map +1 -0
  53. package/dist/api/program/spreadsheet.d.ts +263 -0
  54. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  55. package/dist/api/workspace/index.d.ts +49 -2
  56. package/dist/api/workspace/index.d.ts.map +1 -1
  57. package/dist/errors/codes.d.ts +3 -8
  58. package/dist/errors/codes.d.ts.map +1 -1
  59. package/dist/handles.d.ts +19 -0
  60. package/dist/handles.d.ts.map +1 -1
  61. package/dist/index.cjs +2489 -1941
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.js +2395 -1936
  64. package/dist/index.js.map +1 -1
  65. package/package.json +1 -1
  66. package/src/api/core/io/import/index.ts +11 -3
  67. package/src/api/core/mode/index.ts +19 -7
  68. package/src/api/core/tags.ts +76 -0
  69. package/src/api/design/create/bulk-items.ts +186 -0
  70. package/src/api/design/create/grids.ts +137 -0
  71. package/src/api/design/create/index.ts +472 -70
  72. package/src/api/design/create/opening-fields.ts +37 -0
  73. package/src/api/design/delete/index.ts +5 -20
  74. package/src/api/design/dimensions.ts +453 -0
  75. package/src/api/design/doors/index.ts +20 -13
  76. package/src/api/design/family.ts +51 -4
  77. package/src/api/design/grids.ts +237 -0
  78. package/src/api/design/index.ts +10 -0
  79. package/src/api/design/query/grids.ts +197 -0
  80. package/src/api/design/query/index.ts +27 -2
  81. package/src/api/design/query/spaces.ts +0 -68
  82. package/src/api/design/update/index.ts +53 -0
  83. package/src/api/entity/space.ts +0 -2
  84. package/src/api/presentation/placedViews.ts +1 -29
  85. package/src/api/presentation/sheets.ts +3 -19
  86. package/src/api/program/departments.ts +54 -2
  87. package/src/api/program/index.ts +16 -6
  88. package/src/api/program/labels.ts +332 -0
  89. package/src/api/program/metadata.ts +364 -0
  90. package/src/api/program/spreadsheet.ts +282 -0
  91. package/src/api/workspace/index.ts +51 -2
  92. package/src/errors/codes.ts +2 -30
  93. package/src/handles.ts +24 -0
  94. package/test/errors.test.mjs +0 -4
  95. package/snaptrude-plugin-core-0.11.0.tgz +0 -0
@@ -11,6 +11,7 @@ import { PluginStaircasePreset } from "../create"
11
11
  import { PluginDesignQueryGeometryApi } from "./geometry"
12
12
  import { PluginDesignQuerySpacesApi } from "./spaces"
13
13
  import { PluginDesignQueryReferenceLinesApi } from "./referenceLines"
14
+ import { PluginDesignQueryGridsApi } from "./grids"
14
15
 
15
16
  // ---------------------------------------------------------------------------
16
17
  // Entity type vocabulary
@@ -42,6 +43,7 @@ import { PluginDesignQueryReferenceLinesApi } from "./referenceLines"
42
43
  * | `"mullion"` | Curtain-wall mullion |
43
44
  * | `"panel"` | Curtain-wall panel |
44
45
  * | `"parametricComponent"` | A placed parametric family instance (native or Revit-imported). Its geometry is rebuilt from `design.family` parameters, so read and drive it through `design.family.getParameters` / `setParameters` rather than editing its meshes. |
46
+ * | `"grid"` | Structural grid group |
45
47
  */
46
48
  export const PluginEntityType = z.enum([
47
49
  "wall",
@@ -62,6 +64,7 @@ export const PluginEntityType = z.enum([
62
64
  "mullion",
63
65
  "panel",
64
66
  "parametricComponent",
67
+ "grid",
65
68
  ])
66
69
  export type PluginEntityType = z.infer<typeof PluginEntityType>
67
70
 
@@ -175,7 +178,6 @@ export type PluginDesignQueryComponentsArgs = z.infer<
175
178
  * | `isLocked` | `boolean` | Lock flag |
176
179
  * | `isHidden` | `boolean` | User-hidden flag |
177
180
  * | `isSelected` | `boolean` | Current selection state |
178
- * | `isVisible` | `boolean` | Whether the entity currently has a visible representation on canvas (user hide flag AND LOD/mode gating both considered); read-only |
179
181
  * | `boundingBox` | {@linkcode BBoxComponents} | World-space AABB |
180
182
  * | `adjacency` | `{ spaceId: string; value: number }[]` | Adjacency relationships (spaces/masses only). `value`: `2` = Direct (required), `1` = Indirect or physical contact, `-1` = Restricted; `0` entries are filtered out. `[]` when adjacency has never been computed — see `program.adjacency.compute`. |
181
183
  */
@@ -195,7 +197,6 @@ export const PluginEntityProperties = z
195
197
  isLocked: z.boolean(),
196
198
  isHidden: z.boolean(),
197
199
  isSelected: z.boolean(),
198
- isVisible: z.boolean(),
199
200
  boundingBox: BBoxComponents,
200
201
  adjacency: z.array(z.object({ spaceId: z.string(), value: z.number() })),
201
202
  })
@@ -308,6 +309,8 @@ export abstract class PluginDesignQueryApi {
308
309
  public abstract spaces: PluginDesignQuerySpacesApi
309
310
  /** Reference-line-specific reads. See {@linkcode PluginDesignQueryReferenceLinesApi}. */
310
311
  public abstract referenceLines: PluginDesignQueryReferenceLinesApi
312
+ /** Structural-grid-specific reads. See {@linkcode PluginDesignQueryGridsApi}. */
313
+ public abstract grids: PluginDesignQueryGridsApi
311
314
 
312
315
  constructor() {}
313
316
 
@@ -725,6 +728,27 @@ export abstract class PluginDesignQueryApi {
725
728
  filter?: PluginEntityFilter,
726
729
  ): PluginApiReturn<ComponentHandle[]>
727
730
 
731
+ /**
732
+ * List all the structural grids (grid groups) in the project, optionally
733
+ * filtered by storey, building, selection state, or region.
734
+ *
735
+ * @param filter - an optional {@linkcode PluginEntityFilter}
736
+ * @returns grid-group {@linkcode ComponentHandle}`[]`
737
+ *
738
+ * @examplePrompt List all the structural grids in the model
739
+ * @examplePrompt How many grids are on the ground floor?
740
+ * @examplePrompt Show the grids on this storey
741
+ * @examplePrompt Which grids are currently selected?
742
+ *
743
+ * # Example
744
+ * ```ts
745
+ * const groundFloorGrids = await snaptrude.design.query.listGrids({ storeys: [1] })
746
+ * ```
747
+ */
748
+ public abstract listGrids(
749
+ filter?: PluginEntityFilter,
750
+ ): PluginApiReturn<ComponentHandle[]>
751
+
728
752
  // ── single-entity access & identity ─────────────────────────────────────────
729
753
 
730
754
  /**
@@ -1149,3 +1173,4 @@ export type PluginStoreyOutlineResult = z.infer<
1149
1173
  export * from "./geometry"
1150
1174
  export * from "./spaces"
1151
1175
  export * from "./referenceLines"
1176
+ export * from "./grids"
@@ -124,41 +124,6 @@ export abstract class PluginDesignQuerySpacesApi {
124
124
  public abstract getEnclosure(
125
125
  space: ComponentHandle,
126
126
  ): PluginApiReturn<PluginSpaceEnclosure | null>
127
-
128
- /**
129
- * List the space's **engine-generated BIM components** — the walls, floors
130
- * and slabs the parametric engine derived from this space, grouped by kind.
131
- *
132
- * Unlike {@linkcode getEnclosure} (a geometric best-effort match), this read
133
- * reports the engine's own derivation records, so every returned handle is a
134
- * component the engine created *for this space*.
135
- *
136
- * The derived set is NOT stable across writes: a merge/split/rebuild of the
137
- * space graph retires members and creates successors — re-query after any
138
- * write that touches the space. This is the churn-recovery anchor: when a
139
- * cached derived handle goes stale, call this again to pick up the current
140
- * set.
141
- *
142
- * @param space - The space (room mass) to read
143
- * @returns the generated component handles, grouped by kind
144
- * ({@linkcode PluginSpaceGeneratedBim}); a group is `[]` when the engine
145
- * derived nothing of that kind
146
- * @throws If the space does not exist or the component is not a space/mass
147
- *
148
- * @examplePrompt Which walls did this room generate?
149
- * @examplePrompt List the BIM components derived from the selected space
150
- * @examplePrompt Get the floors and slabs that belong to this room
151
- *
152
- * # Example
153
- * ```ts
154
- * const [space] = await snaptrude.design.query.listSpaces()
155
- * const bim = await snaptrude.design.query.spaces.listGeneratedBim(space)
156
- * console.log(`${bim.walls.length} walls, ${bim.floors.length} floors`)
157
- * ```
158
- */
159
- public abstract listGeneratedBim(
160
- space: ComponentHandle,
161
- ): PluginApiReturn<PluginSpaceGeneratedBim>
162
127
  }
163
128
 
164
129
  /**
@@ -308,36 +273,3 @@ export const PluginSpaceEnclosure = z.object({
308
273
  adjacentSpaces: z.array(PluginAdjacentSpace),
309
274
  })
310
275
  export type PluginSpaceEnclosure = z.infer<typeof PluginSpaceEnclosure>
311
-
312
- /**
313
- * Arguments for {@linkcode PluginDesignQuerySpacesApi.listGeneratedBim}.
314
- *
315
- * | Property | Type | Description |
316
- * |---|---|---|
317
- * | `space` | {@linkcode ComponentHandle} | The space (room mass) to read |
318
- */
319
- export const PluginDesignQuerySpacesListGeneratedBimArgs = z.object({
320
- space: ComponentHandle,
321
- })
322
- export type PluginDesignQuerySpacesListGeneratedBimArgs = z.infer<
323
- typeof PluginDesignQuerySpacesListGeneratedBimArgs
324
- >
325
-
326
- /**
327
- * Result of {@linkcode PluginDesignQuerySpacesApi.listGeneratedBim} — the
328
- * space's engine-generated BIM component handles, grouped by kind. The set
329
- * changes whenever a write merges/splits/rebuilds the space graph — re-query
330
- * after writes rather than caching it.
331
- *
332
- * | Property | Type | Description |
333
- * |---|---|---|
334
- * | `walls` | {@linkcode ComponentHandle}`[]` | Walls the engine derived from the space |
335
- * | `floors` | {@linkcode ComponentHandle}`[]` | Floors the engine derived from the space |
336
- * | `slabs` | {@linkcode ComponentHandle}`[]` | Slabs the engine derived from the space |
337
- */
338
- export const PluginSpaceGeneratedBim = z.object({
339
- walls: z.array(ComponentHandle),
340
- floors: z.array(ComponentHandle),
341
- slabs: z.array(ComponentHandle),
342
- })
343
- export type PluginSpaceGeneratedBim = z.infer<typeof PluginSpaceGeneratedBim>
@@ -15,6 +15,7 @@ import {
15
15
  PluginBuildableEnvelopeVerticalCap,
16
16
  PluginBuildableEnvelopeUpdateResult,
17
17
  } from "../../entity/buildableEnvelope"
18
+ import { PluginGridStyleOptions } from "../create/grids"
18
19
 
19
20
  /**
20
21
  * Sparse property updates for a space. Only provided fields change.
@@ -238,6 +239,27 @@ export type PluginDesignSetStoreyArgs = z.infer<
238
239
  typeof PluginDesignSetStoreyArgs
239
240
  >
240
241
 
242
+ /**
243
+ * The sparse GROUP-LEVEL patch accepted by {@linkcode PluginDesignUpdateApi.grid}.
244
+ * Only provided fields change. Wing- and line-level updates live on the grids
245
+ * entity family: `design.grids.updateWings` / `design.grids.updateLines`.
246
+ */
247
+ export const PluginGridPatch = z.object({
248
+ angle: z.number().finite().optional(),
249
+ props: PluginGridStyleOptions.optional(),
250
+ storeyVisibility: z
251
+ .array(z.object({ storey: z.number().int(), visible: z.boolean() }))
252
+ .optional(),
253
+ })
254
+ export type PluginGridPatch = z.infer<typeof PluginGridPatch>
255
+
256
+ /** Arguments for {@linkcode PluginDesignUpdateApi.grid}. */
257
+ export const PluginDesignUpdateGridArgs = z.object({
258
+ grid: ComponentHandle,
259
+ patch: PluginGridPatch,
260
+ })
261
+ export type PluginDesignUpdateGridArgs = z.infer<typeof PluginDesignUpdateGridArgs>
262
+
241
263
  /**
242
264
  * `snaptrude.design.update` — edit existing scene entities (properties + geometry).
243
265
  *
@@ -290,6 +312,37 @@ export abstract class PluginDesignUpdateApi {
290
312
  label: string,
291
313
  ): PluginApiReturn<boolean>
292
314
 
315
+ /**
316
+ * Update a structural grid's **group-level** fields with a sparse patch —
317
+ * default line styling, absolute angle, and per-storey 2D visibility. Only
318
+ * provided fields change. Wing- and line-level updates live on the grids
319
+ * entity family: {@linkcode PluginDesignGridsApi.updateWings} /
320
+ * {@linkcode PluginDesignGridsApi.updateLines}.
321
+ *
322
+ * Every change routes through the exact setters the native panel uses —
323
+ * each changed field commits its own undoable command, identical to editing
324
+ * that field in the panel. `angle` is an absolute target in degrees (CCW
325
+ * about +Y).
326
+ *
327
+ * @param grid - The grid group to update
328
+ * @param patch - The sparse {@linkcode PluginGridPatch}
329
+ * @returns `true` once applied
330
+ *
331
+ * @examplePrompt Rotate the grid to 45 degrees
332
+ * @examplePrompt Make this grid's lines dashed and grey
333
+ * @examplePrompt Hide this grid on storey 3's plan
334
+ *
335
+ * # Example
336
+ * ```ts
337
+ * const [grid] = await snaptrude.design.query.listGrids()
338
+ * await snaptrude.design.update.grid(grid, { angle: 45, props: { style: "DASHED" } })
339
+ * ```
340
+ */
341
+ public abstract grid(
342
+ grid: ComponentHandle,
343
+ patch: PluginGridPatch,
344
+ ): PluginApiReturn<boolean>
345
+
293
346
  /**
294
347
  * Update a single space (room) — change its properties (room label, space
295
348
  * type, mass type, area class, department) and/or replace its geometry by
@@ -434,7 +434,6 @@ export type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>
434
434
  * | `massType` | `string?` | Updated mass type (if changed) |
435
435
  * | `spaceType` | `string?` | Updated space type (if changed) |
436
436
  * | `departmentId` | `string \| null?` | Updated department ID (if changed) |
437
- * | `rebuilt` | `boolean?` | `true` when a geometry update rebuilt the space's derived BIM — hosted children were re-created and the previous derived handles are retired (re-query them) |
438
437
  */
439
438
  export const PluginSpaceUpdateResult = z.object({
440
439
  spaceId: z.string(),
@@ -443,7 +442,6 @@ export const PluginSpaceUpdateResult = z.object({
443
442
  spaceType: z.string().optional(),
444
443
  areaClass: PluginAreaClass.optional(),
445
444
  departmentId: z.string().nullable().optional(),
446
- rebuilt: z.boolean().optional(),
447
445
  })
448
446
 
449
447
  export type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../types"
3
- import { PluginSheetPosition, PluginViewLod } from "./sheets"
3
+ import { PluginSheetPosition } from "./sheets"
4
4
 
5
5
  /**
6
6
  * Placed views — the view shapes already laid out on the Present canvas.
@@ -613,23 +613,6 @@ export abstract class PluginPresentationPlacedViewsApi {
613
613
  shapeId: string,
614
614
  enabled: boolean,
615
615
  ): PluginApiReturn<void>
616
-
617
- /**
618
- * Set the level of detail a placed view renders at — `"design"` (the
619
- * Design-mode massing representation) or `"bim"` (the detailed BIM
620
- * representation). Views only. Undoable. Requires Present mode to be open.
621
- *
622
- * @param shapeId - The placed view shape.
623
- * @param lod - Target level of detail.
624
- * @throws If Present mode is not open or `shapeId` is not a placed view.
625
- *
626
- * @examplePrompt Switch this placed view to the BIM level of detail
627
- * @examplePrompt Show the massing version of the placed plan
628
- */
629
- public abstract setLod(
630
- shapeId: string,
631
- lod: PluginViewLod,
632
- ): PluginApiReturn<void>
633
616
  }
634
617
 
635
618
  /** A point in crop space — fractions (0–1) of the uncropped view. */
@@ -674,8 +657,6 @@ export type PluginPlacedViewCrop = z.infer<typeof PluginPlacedViewCrop>
674
657
  * | `rotation` | `number` | Rotation in radians, `[0, 2π)` (nonzero only for 3D views — 2D views cannot rotate; set with `setRotation`) |
675
658
  * | `crop` | {@linkcode PluginPlacedViewCrop}` \| null` | Crop window (`null` when uncropped) |
676
659
  * | `isUnlinked` | `boolean` | Whether the source proposal was removed (an unlinked view no longer refreshes) |
677
- * | `lod` | {@linkcode PluginViewLod}? | Level of detail the view renders at (`"design"` massing / `"bim"` detail); absent on views that predate LOD variants (set with `setLod`) |
678
- * | `inactiveBuildingMask` | `boolean`? | Whether inactive proposal buildings are masked (the `setMask` toggle); absent when never set (masked by default) |
679
660
  */
680
661
  export const PluginPlacedView = z.object({
681
662
  shapeId: z.string(),
@@ -689,8 +670,6 @@ export const PluginPlacedView = z.object({
689
670
  rotation: z.number(),
690
671
  crop: PluginPlacedViewCrop.nullable(),
691
672
  isUnlinked: z.boolean(),
692
- lod: PluginViewLod.optional(),
693
- inactiveBuildingMask: z.boolean().optional(),
694
673
  })
695
674
  export type PluginPlacedView = z.infer<typeof PluginPlacedView>
696
675
 
@@ -1139,10 +1118,3 @@ export const PluginPlacedViewsSetMaskArgs = z.object({
1139
1118
  enabled: z.boolean(),
1140
1119
  })
1141
1120
  export type PluginPlacedViewsSetMaskArgs = z.infer<typeof PluginPlacedViewsSetMaskArgs>
1142
-
1143
- /** Arguments for {@link PluginPresentationPlacedViewsApi.setLod}. */
1144
- export const PluginPlacedViewsSetLodArgs = z.object({
1145
- shapeId: z.string().min(1),
1146
- lod: PluginViewLod,
1147
- })
1148
- export type PluginPlacedViewsSetLodArgs = z.infer<typeof PluginPlacedViewsSetLodArgs>
@@ -172,10 +172,9 @@ export abstract class PluginPresentationSheetsApi {
172
172
  * @param sheetId - The id of the sheet to place onto.
173
173
  * @param viewId - The id of the saved view to place.
174
174
  * @param options - Optional `position` ({@linkcode PluginSheetPosition}) —
175
- * where to place it (sheet centre when omitted) — `scale` — a standard
175
+ * where to place it (sheet centre when omitted) — and `scale` — a standard
176
176
  * scale value for the project's unit system (2D/site-plan views only;
177
- * auto-fit when omitted) — and `lod` ({@linkcode PluginViewLod}) — the LOD
178
- * of the placed view (default: the product's Design default).
177
+ * auto-fit when omitted).
179
178
  * @returns A {@linkcode PluginPresentationSheetsPlaceResult} with the created
180
179
  * `shapeId`.
181
180
  * @throws If Present mode is not open, the sheet/view id is invalid, `scale`
@@ -198,11 +197,7 @@ export abstract class PluginPresentationSheetsApi {
198
197
  public abstract place(
199
198
  sheetId: string,
200
199
  viewId: string,
201
- options?: {
202
- position?: PluginSheetPosition
203
- scale?: number
204
- lod?: PluginViewLod
205
- },
200
+ options?: { position?: PluginSheetPosition; scale?: number },
206
201
  ): PluginApiReturn<PluginPresentationSheetsPlaceResult>
207
202
 
208
203
  /**
@@ -413,15 +408,6 @@ export const PluginSheetPosition = z.object({
413
408
  })
414
409
  export type PluginSheetPosition = z.infer<typeof PluginSheetPosition>
415
410
 
416
- /**
417
- * The level of detail a placed view renders at: `"design"` (the Design-mode
418
- * massing representation) or `"bim"` (the detailed BIM representation).
419
- * Shared by `sheets.place` and `placedViews.*` (defined here because
420
- * `placedViews` already imports from this module).
421
- */
422
- export const PluginViewLod = z.enum(["design", "bim"])
423
- export type PluginViewLod = z.infer<typeof PluginViewLod>
424
-
425
411
  /** Result of {@linkcode PluginPresentationSheetsApi.list}. */
426
412
  export const PluginPresentationSheetsListResult = z.object({
427
413
  sheets: z.array(PluginPresentationSheet),
@@ -483,14 +469,12 @@ export type PluginPresentationSheetsSetMarginArgs = z.infer<
483
469
  * | `viewId` | `string` | The saved view to place |
484
470
  * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (sheet centre when omitted) |
485
471
  * | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only; auto-fit to the closest standard scale when omitted) |
486
- * | `lod` | {@linkcode PluginViewLod}` \| undefined` | LOD of the placed view (default: the product's Design default) |
487
472
  */
488
473
  export const PluginPresentationSheetsPlaceArgs = z.object({
489
474
  sheetId: z.string(),
490
475
  viewId: z.string(),
491
476
  position: PluginSheetPosition.optional(),
492
477
  scale: z.number().positive().optional(),
493
- lod: PluginViewLod.optional(),
494
478
  })
495
479
  export type PluginPresentationSheetsPlaceArgs = z.infer<
496
480
  typeof PluginPresentationSheetsPlaceArgs
@@ -7,7 +7,7 @@ import { ComponentHandle } from "../../handles"
7
7
  * Program departments — read the department groupings of the active program.
8
8
  *
9
9
  * In program mode a **department** is a named, colored grouping of spaces with an
10
- * optional area **target**. This is the program-planning view of departments
10
+ * optional gross area **target** and a unit **count** target. This is the program-planning view of departments
11
11
  * (their identity, color, and target area); the underlying space geometry is read
12
12
  * and edited through the geometry namespaces, not here.
13
13
  *
@@ -203,6 +203,33 @@ export abstract class PluginProgramDepartmentsApi {
203
203
  units?: PluginAreaUnit,
204
204
  ): PluginApiReturn<PluginProgramDepartmentsSetTargetAreaResult>
205
205
 
206
+ /**
207
+ * Set a department's target unit count.
208
+ *
209
+ * The number of units (program blocks) the department is planned for — the
210
+ * count twin of {@linkcode PluginProgramDepartmentsApi.setTargetArea}, stored
211
+ * beside the gross area target on the department. Read it back from
212
+ * {@linkcode PluginProgramDepartmentsApi.get} (`targetCount`).
213
+ *
214
+ * @param departmentId - The id of the department whose count to set.
215
+ * @param targetCount - The target number of units (a non-negative integer).
216
+ * @returns The updated {@linkcode PluginProgramDepartment} with its `units`.
217
+ * @throws If no department has the given id.
218
+ *
219
+ * @examplePrompt Set the Bedrooms department unit count to 12
220
+ * @examplePrompt The program needs 4 clinic blocks — update the department count
221
+ * @examplePrompt Update the target count for department dep_123
222
+ *
223
+ * # Example
224
+ * ```ts
225
+ * await snaptrude.program.departments.setTargetCount("dep_123", 12)
226
+ * ```
227
+ */
228
+ public abstract setTargetCount(
229
+ departmentId: string,
230
+ targetCount: number,
231
+ ): PluginApiReturn<PluginProgramDepartmentsSetTargetCountResult>
232
+
206
233
  /**
207
234
  * Delete a department.
208
235
  *
@@ -239,13 +266,15 @@ export abstract class PluginProgramDepartmentsApi {
239
266
  * | `id` | `string` | Unique department id |
240
267
  * | `name` | `string` | Display name |
241
268
  * | `color` | `string` | CSS hex color string (e.g. `"#b5e1dc"`) |
242
- * | `targetArea` | `number \| null` | Target area in the response's `units`, or `null` if no target is set |
269
+ * | `targetArea` | `number \| null` | Gross target area in the response's `units`, or `null` if no target is set |
270
+ * | `targetCount` | `number` | Target number of units / program blocks (`0` when unset) |
243
271
  */
244
272
  export const PluginProgramDepartment = z.object({
245
273
  id: z.string(),
246
274
  name: z.string(),
247
275
  color: z.string(),
248
276
  targetArea: z.number().nullable(),
277
+ targetCount: z.number(),
249
278
  })
250
279
  export type PluginProgramDepartment = z.infer<typeof PluginProgramDepartment>
251
280
 
@@ -434,6 +463,29 @@ export type PluginProgramDepartmentsSetTargetAreaResult = z.infer<
434
463
  typeof PluginProgramDepartmentsSetTargetAreaResult
435
464
  >
436
465
 
466
+ /**
467
+ * Arguments for {@linkcode PluginProgramDepartmentsApi.setTargetCount}.
468
+ *
469
+ * | Property | Type | Description |
470
+ * |---|---|---|
471
+ * | `departmentId` | `string` | The id of the department whose count to set |
472
+ * | `targetCount` | `number` | Target number of units (non-negative integer) |
473
+ */
474
+ export const PluginProgramDepartmentsSetTargetCountArgs = z.object({
475
+ departmentId: z.string(),
476
+ targetCount: z.number().int().nonnegative(),
477
+ })
478
+ export type PluginProgramDepartmentsSetTargetCountArgs = z.infer<
479
+ typeof PluginProgramDepartmentsSetTargetCountArgs
480
+ >
481
+
482
+ /** Result of {@linkcode PluginProgramDepartmentsApi.setTargetCount} — the updated record with `units`. */
483
+ export const PluginProgramDepartmentsSetTargetCountResult =
484
+ PluginProgramDepartmentRecord
485
+ export type PluginProgramDepartmentsSetTargetCountResult = z.infer<
486
+ typeof PluginProgramDepartmentsSetTargetCountResult
487
+ >
488
+
437
489
  /**
438
490
  * Arguments for {@linkcode PluginProgramDepartmentsApi.delete}.
439
491
  *
@@ -7,22 +7,26 @@ import { PluginProgramSiteApi } from "./site"
7
7
  import { PluginProgramCoresApi } from "./cores"
8
8
  import { PluginProgramClassificationApi } from "./classification"
9
9
  import { PluginProgramAreasApi } from "./areas"
10
+ import { PluginProgramMetadataApi } from "./metadata"
11
+ import { PluginProgramLabelsApi } from "./labels"
10
12
 
11
13
  /**
12
14
  * Program-mode planning APIs.
13
15
  *
14
16
  * The program is the space-planning layer: department groupings with area targets,
15
- * the metrics that track allocated area against those targets, and the reports
16
- * that render program/takeoff data to spreadsheet sheets. Reads describe the
17
- * *plan* (intent + targets); the geometry that realizes the plan is authored
18
- * through the geometry namespaces.
17
+ * the labels (program rows) inside them, the metrics that track allocated area
18
+ * against those targets, and the reports that render program/takeoff data to
19
+ * spreadsheet sheets. Reads describe the *plan* (intent + targets); the geometry
20
+ * that realizes the plan is authored through the geometry namespaces.
19
21
  *
20
22
  * - {@linkcode PluginProgramApi.departments} — Read & edit program departments (groupings + targets)
23
+ * - {@linkcode PluginProgramApi.labels} — Read & edit program labels (program rows: per-type area/count targets)
24
+ * - {@linkcode PluginProgramApi.metadata} — Read & edit program metadata (custom columns) on spaces
21
25
  * - {@linkcode PluginProgramApi.adjacency} — Read & compute the department/space adjacency matrix
22
26
  * - {@linkcode PluginProgramApi.layout} — Arrange/pack spaces in the envelope
23
27
  * - {@linkcode PluginProgramApi.metrics} — Read the area-program summary
24
28
  * - {@linkcode PluginProgramApi.areas} — FAR / built-up-area rollup and groupings
25
- * - {@linkcode PluginProgramApi.spreadsheet} — Render program data to sheets and read it back
29
+ * - {@linkcode PluginProgramApi.spreadsheet} — Render program data to sheets, custom grouped sheets, read back
26
30
  * - {@linkcode PluginProgramApi.site} — Read site/plot context and read/update Site Analysis
27
31
  * - {@linkcode PluginProgramApi.cores} — Read & predicate vertical-circulation cores (reads only)
28
32
  * - {@linkcode PluginProgramApi.classification} — Classification catalog + display tags
@@ -32,6 +36,10 @@ import { PluginProgramAreasApi } from "./areas"
32
36
  export abstract class PluginProgramApi {
33
37
  /** Program departments — groupings, area targets, and space assignment. See {@linkcode PluginProgramDepartmentsApi}. */
34
38
  public abstract departments: PluginProgramDepartmentsApi
39
+ /** Program labels — the program rows with per-type area/count targets. See {@linkcode PluginProgramLabelsApi}. */
40
+ public abstract labels: PluginProgramLabelsApi
41
+ /** Program metadata — custom columns and their per-space values. See {@linkcode PluginProgramMetadataApi}. */
42
+ public abstract metadata: PluginProgramMetadataApi
35
43
  /** Adjacency matrix — read & compute proximity relationships. See {@linkcode PluginProgramAdjacencyApi}. */
36
44
  public abstract adjacency: PluginProgramAdjacencyApi
37
45
  /** Arrange/pack spaces in the envelope (async job family). See {@linkcode PluginProgramLayoutApi}. */
@@ -40,7 +48,7 @@ export abstract class PluginProgramApi {
40
48
  public abstract metrics: PluginProgramMetricsApi
41
49
  /** FAR / built-up-area rollup and groupings. See {@linkcode PluginProgramAreasApi}. */
42
50
  public abstract areas: PluginProgramAreasApi
43
- /** Spreadsheet reports — render tables to sheets, export, list, read back. See {@linkcode PluginProgramSpreadsheetApi}. */
51
+ /** Spreadsheet reports — render tables to sheets, custom grouped sheets, export, read back. See {@linkcode PluginProgramSpreadsheetApi}. */
44
52
  public abstract spreadsheet: PluginProgramSpreadsheetApi
45
53
  /** Site/plot context and persisted Site Analysis. See {@linkcode PluginProgramSiteApi}. */
46
54
  public abstract site: PluginProgramSiteApi
@@ -61,3 +69,5 @@ export * from "./site"
61
69
  export * from "./cores"
62
70
  export * from "./classification"
63
71
  export * from "./areas"
72
+ export * from "./metadata"
73
+ export * from "./labels"