Levels
Levels are datums in the Revit model that define building storeys. In DAQS, they appear as objects in the flat array and are referenced by FamilyInstance objects via values.levelId.
The Level object
{
"id": 311,
"type": "Level",
"name": "00 begane grond",
"parent": null,
"values": {
"elevation": 0.0
}
}
How instances reference levels
A FamilyInstance stores the level it is placed on as a numeric ID:
{
"id": 616521,
"type": "FamilyInstance",
"values": {
"levelId": 311
}
}
This levelId corresponds to the id of a Level object in the same dataset.
Resolving level name from instance
To include the level name in the filter output, look up the Level object by the instance's levelId:
(
$levelIndex := $merge(
$[type = "Level"].{ $string(id): name }
);
$[type = "FamilyInstance"].{
"id": id,
"name": name,
"levelId": values.levelId,
"levelName": $lookup($levelIndex, $string(values.levelId))
}
)
The $levelIndex maps level IDs to level names. Each instance can then resolve its level name for display in error messages.
Filtering instances by level
To restrict a rule to instances on a specific level:
(
$targetLevelId := $[type = "Level" and name = "00 begane grond"].id;
$[type = "FamilyInstance" and values.levelId = $targetLevelId].{
"id": id,
"name": name
}
)
Use the level id for linking — not the name, which can be renamed.
Common mistakes
- Comparing
values.levelIddirectly to a level name —levelIdis a number, not a string - Assuming
levelIdexists on all instances — some elements (like model groups) may not have one