Fix bug when copying objects, don't copy their decomposition to prevent invalid IFCs.

This commit is contained in:
Dion Moult
2021-08-30 18:59:50 +10:00
parent 6addbd935f
commit 6b33b23a29
@@ -24,6 +24,8 @@ class Usecase:
inverse.RelatedObjects = [to_element]
pset = ifcopenshell.util.element.copy_deep(self.file, inverse.RelatingPropertyDefinition)
inverse.RelatingPropertyDefinition = pset
if inverse.is_a("IfcRelAggregates") and inverse.RelatingObject == from_element:
continue
else:
# TODO: Consider whether this general approach is good or not. Maybe it isn't.
for i, value in enumerate(inverse):