mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Support other voiding IfcFeatureElementSubtraction elements #3889
Support other voiding IfcFeatureElementSubtraction besides IfcOpeningElement.
This commit is contained in:
@@ -120,6 +120,7 @@ class TestCopyClass(test.bootstrap.IFC4):
|
||||
assert new.RepresentationMaps is None
|
||||
|
||||
def test_copying_an_element_with_an_opening(self):
|
||||
# IfcOpeningElement opening
|
||||
wall = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
opening = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcOpeningElement")
|
||||
ifcopenshell.api.run("void.add_opening", self.file, opening=opening, element=wall)
|
||||
@@ -129,6 +130,16 @@ class TestCopyClass(test.bootstrap.IFC4):
|
||||
assert new.HasOpenings[0].RelatedOpeningElement != opening
|
||||
assert new.HasOpenings[0].RelatedOpeningElement.is_a("IfcOpeningElement")
|
||||
|
||||
# IfcVoidingFeature opening
|
||||
plate = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcPlate")
|
||||
opening = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcVoidingFeature")
|
||||
ifcopenshell.api.run("void.add_opening", self.file, opening=opening, element=plate)
|
||||
new = ifcopenshell.api.run("root.copy_class", self.file, product=plate)
|
||||
assert plate.HasOpenings[0] != new.HasOpenings[0]
|
||||
assert plate.HasOpenings[0].RelatedOpeningElement == opening
|
||||
assert new.HasOpenings[0].RelatedOpeningElement != opening
|
||||
assert new.HasOpenings[0].RelatedOpeningElement.is_a("IfcVoidingFeature")
|
||||
|
||||
def test_copying_an_element_with_a_filled_opening_should_not_copy_the_opening_nor_fill(self):
|
||||
wall = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
opening = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcOpeningElement")
|
||||
|
||||
Reference in New Issue
Block a user