mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Removing an element now also purges connection relationships
This commit is contained in:
@@ -184,3 +184,14 @@ class TestRemoveProduct(test.bootstrap.IFC4):
|
||||
assert len(self.file.by_type("IfcRelContainedInSpatialStructure")) == 0
|
||||
assert len(self.file.by_type("IfcSpace")) == 1
|
||||
assert len(self.file.by_type("IfcWall")) == 0
|
||||
|
||||
def test_removing_path_connection_relationships_of_an_element(self):
|
||||
element1 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcBeam")
|
||||
element2 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcColumn")
|
||||
ifcopenshell.api.run("geometry.connect_path", self.file, relating_element=element1, related_element=element2)
|
||||
total_entities = len(list(self.file))
|
||||
ifcopenshell.api.run("root.remove_product", self.file, product=element1)
|
||||
assert len(list(self.file)) == total_entities - 2
|
||||
assert len(self.file.by_type("IfcRelConnectsPathElements")) == 0
|
||||
assert len(self.file.by_type("IfcColumn")) == 1
|
||||
assert len(self.file.by_type("IfcBeam")) == 0
|
||||
|
||||
Reference in New Issue
Block a user