mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user