Appearance
Classification
The catalog of space-classification options, and a space's display tags. listTypes returns the selectable space types, area classes, and mass types; listTags returns one space's tags grouped by category. Accessed via snaptrude.program.classification.
Both methods are reads — nothing on this page mutates the model. All methods are host API calls that return Promises. listTypes is static and project-independent. listTags never throws for a missing space — it returns an empty result (tagIds: [], tagsByCategory: {}).
At a glance
| Method | What it does | Mutates? |
|---|---|---|
listTypes() | The static catalog of space-type / area-class / mass-type options | — |
listTags(id) | A space's display tags, grouped by category | — |
Per-space classification lives on the space
Reading or changing a single space's classification (its type, label, area class, or department) is done through the snaptrude.entity.space reads/writes, not here. Tag definitions are managed elsewhere — these methods are display-only.
Types
PluginClassificationOption
A selectable classification option.
| Property | Type | Description |
|---|---|---|
value | string | Stored value |
label | string | Display label |
PluginSpaceTag
A display tag on a space.
| Property | Type | Description |
|---|---|---|
tagId | string | Tag id |
tagName | string | Tag display name |
color | string | CSS hex color string |
categoryId | string | Id of the tag's category |
Functions
listTypes()
List the selectable classification options for spaces — the static, project-independent catalog of space types, area classes, and mass types a space can be classified as.
- Returns:
{ spaceTypes: PluginClassificationOption[], areaClasses: PluginClassificationOption[], massTypes: PluginClassificationOption[] }—areaClassesis the NET/GROSS/EXCLUDED set.
ts
const { spaceTypes, areaClasses, massTypes } = await snaptrude.program.classification.listTypes();
for (const t of spaceTypes) console.log(t.value, t.label);listTags(id)
List a space's tags for display, grouped by category.
- Parameters:
id:string— the id of the space whose tags to read
- Returns:
{ tagIds: string[], tagsByCategory: Record<string, PluginSpaceTag> }—tagsByCategoryis keyed by category name; both are empty when the space is missing or untagged.
ts
const { tagsByCategory } = await snaptrude.program.classification.listTags("sp_4");
for (const [category, tag] of Object.entries(tagsByCategory)) {
console.log(category, tag.tagName, tag.color);
}Errors
Failed calls reject with a typed PluginError — see Error Handling. This namespace has no specific error conditions: both reads are total. listTypes is a static catalog, and listTags returns an empty result (tagIds: [], tagsByCategory: {}) for a missing or untagged space rather than throwing.