Changing aggregation now ensures spatial containment is mutually exclusive to prevent invalid IFC data

This commit is contained in:
Dion Moult
2021-10-06 12:52:01 +11:00
parent f21005c29e
commit 3aa36dd4b7
7 changed files with 141 additions and 7 deletions
@@ -78,12 +78,16 @@ def get_material(element, should_skip_usage=False):
return get_material(relating_type, should_skip_usage)
def get_container(element):
aggregate = get_aggregate(element)
if aggregate:
return get_container(aggregate)
if hasattr(element, "ContainedInStructure") and element.ContainedInStructure:
return element.ContainedInStructure[0].RelatingStructure
def get_container(element, should_get_direct=False):
if should_get_direct:
if hasattr(element, "ContainedInStructure") and element.ContainedInStructure:
return element.ContainedInStructure[0].RelatingStructure
else:
aggregate = get_aggregate(element)
if aggregate:
return get_container(aggregate, should_get_direct)
if hasattr(element, "ContainedInStructure") and element.ContainedInStructure:
return element.ContainedInStructure[0].RelatingStructure
def get_decomposition(element):