Minor fix to accommodate null descriptions and parents with no attributes

# Conflicts:
#	src/ifcopenshell-python/ifcopenshell/util/doc.py
This commit is contained in:
Dion Moult
2022-11-03 17:13:56 +11:00
parent 20198bccdb
commit adc59de2bf
3 changed files with 5 additions and 3 deletions
@@ -93,7 +93,7 @@ def get_entity_doc(version, entity_name, recursive=True):
parent_entity = get_entity_doc(version, ifc_supertype.name(), recursive=True)
if "attributes" not in entity:
entity["attributes"] = dict()
for parent_attr in parent_entity["attributes"]:
for parent_attr in parent_entity.get("attributes", []):
entity["attributes"][parent_attr] = parent_entity["attributes"][parent_attr]
return entity
@@ -376,6 +376,7 @@ def get_decomposition(element):
results.append(rel.RelatedBuildingElement)
return results
def get_grouped_by(element):
"""
Retrieves all subelements of an element based on the group.
@@ -396,7 +397,8 @@ def get_grouped_by(element):
queue.extend(rel.RelatedObjects)
results.extend(rel.RelatedObjects)
return results
def get_aggregate(element):
"""
Retrieves the aggregate of an element.