Fix wall split: preserve door/window fill rel

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.
This commit is contained in:
Gorgious56
2026-05-21 22:13:43 +02:00
parent 1855e4c019
commit f41f5dfdd8
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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)
@@ -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