mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Fix bug where copying a type also copied its type relations which is invalid.
This commit is contained in:
@@ -116,3 +116,10 @@ class TestCopyClass(test.bootstrap.IFC4):
|
||||
new = ifcopenshell.api.run("root.copy_class", self.file, product=element)
|
||||
assert new.HasAssociations[0].RelatingMaterial != element.HasAssociations[0].RelatingMaterial
|
||||
assert new.HasAssociations[0].RelatingMaterial.is_a("IfcMaterialLayerSetUsage")
|
||||
|
||||
def test_copying_a_type_and_purging_type_relationships(self):
|
||||
type = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWallType")
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
ifcopenshell.api.run("type.assign_type", self.file, related_object=element, relating_type=type)
|
||||
new = ifcopenshell.api.run("root.copy_class", self.file, product=type)
|
||||
assert not new.Types
|
||||
|
||||
Reference in New Issue
Block a user