From 26502a1a2a4b58ca26f94a908fe2872291c406c3 Mon Sep 17 00:00:00 2001 From: Gorgious56 Date: Thu, 21 May 2026 22:13:43 +0200 Subject: [PATCH] Fix wall split: preserve door/window fill rel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splitting a wall through a door orphaned the door (door.FillsVoids became empty). The fill rel was being reassigned by setting its RelatedBuildingElement slot — schema-wise that's the filling slot, not the wall slot — so when remove_feature deleted the old opening it also cascade-removed the rel. Transferring via RelatingOpeningElement keeps the rel pointing at the new opening so the door stays associated. Pre-existing bug from 5a6476a57, surfaced by ef144dce2. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/bim/module/model/wall.py | 2 +- src/bonsai/test/bim/feature/model.feature | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index c43bf2a7d2..0bedb86fc6 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -1364,7 +1364,7 @@ class DumbWallJoiner: tool.Ifc.get(), opening.Representation, exclude=["IfcGeometricRepresentationContext"] ) - rel.RelatedBuildingElement = element2 + rel.RelatingOpeningElement = new_opening # Remove the old opening ifcopenshell.api.feature.remove_feature(tool.Ifc.get(), feature=opening) diff --git a/src/bonsai/test/bim/feature/model.feature b/src/bonsai/test/bim/feature/model.feature index bfae14c6f6..1cab957837 100644 --- a/src/bonsai/test/bim/feature/model.feature +++ b/src/bonsai/test/bim/feature/model.feature @@ -285,6 +285,7 @@ Scenario: Split a wall which has a flipped door And the object "IfcWall/Wall" is selected And I press "bim.hotkey(hotkey='S_K')" Then the object "IfcDoor/Door" is at "8.01,0.1,0" + And the object "IfcWall/Wall.001" is filled by "IfcDoor/Door" Scenario: Offset walls Given an empty IFC project