You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IfcSpace is written into its storey's IfcRelContainedInSpatialStructure instead of IfcRelAggregates (SPS002, SPS007) #743
rvt-ifc lists every room's IfcSpace among the elements of its storey's IfcRelContainedInSpatialStructure. In IFC4 that relation holds elements, grids and annotations; a space is a spatial element and belongs in the spatial decomposition through IfcRelAggregates. As written, no IfcSpace has a parent in the spatial tree:
buildingSMART's validation rules flag it: SPS002 (each IfcSpatialElement aggregated as per the spatial composition table) and SPS007 ("All other IFC entities must not be contained within a spatial structure").
IfcOpenShell finds no container or aggregate for the space (IfcSpace has no ContainedInStructure inverse in IFC4), so a reader that walks the tree finds no storey for the room, nor for anything contained in it.
The second point became visible with B63: on main, furniture, fixtures and equipment are contained in their room's space, so they lose their storey too. Measured on Autodesk's Snowdon Towers Sample Architectural (Revit 2024; built with #737 so the file reads) against a Revit 2024 IFC4 Reference View export of the same file (build 24.3.50.51), matching by Tag: 5,945 elements in both; with v0.4.0, 5,581 sit on Revit's storey; on main + #737, 4,813, and 785 are in an IfcSpace that has no storey.
Reproduce
rvt-ifc 2024_Core_Interior.rvt -o ci.ifc # magnetar-io corpus
python -c "import ifcopenshell, ifcopenshell.util.element as ue; f=ifcopenshell.open('ci.ifc'); \
print(sum(1 for s in f.by_type('IfcSpace') if ue.get_aggregate(s)), 'of', len(f.by_type('IfcSpace')), 'spaces have a parent')"
# 0 of 116
A pull request with a fix follows: each space is aggregated into its storey, or into the building where no storey join reached it.
This shipped in v0.5.0 with your #744: each IfcSpace is aggregated into its storey. The changelog's "Upgrading from 0.4" covers it for anyone reading rooms from the containment relation. v0.5.1 is the latest release.
Activity
fix(ifc): aggregate each IfcSpace into its storey instead of containi…
DrunkOnJava commentedon Oct 18, 2026
This shipped in v0.5.0 with your #744: each
IfcSpaceis aggregated into its storey. The changelog's "Upgrading from 0.4" covers it for anyone reading rooms from the containment relation. v0.5.1 is the latest release.