Fix bug where copying elements didn't ensure that material usages were unique

This commit is contained in:
Dion Moult
2021-10-22 12:09:57 +11:00
parent a8c99cebaf
commit a5b8728aec
2 changed files with 12 additions and 0 deletions
@@ -33,6 +33,10 @@ class Usecase:
continue
elif inverse.is_a("IfcRelFillsElement"):
continue
elif inverse.is_a("IfcRelAssociatesMaterial") and "Usage" in inverse.RelatingMaterial.is_a():
inverse = ifcopenshell.util.element.copy(self.file, inverse)
inverse.RelatingMaterial = ifcopenshell.util.element.copy(self.file, inverse.RelatingMaterial)
inverse.RelatedObjects = [to_element]
else:
for i, value in enumerate(inverse):
if value == from_element: