diff --git a/src/blenderbim/blenderbim/bim/helper.py b/src/blenderbim/blenderbim/bim/helper.py index 5b4c32a35b..14e2b3fc49 100644 --- a/src/blenderbim/blenderbim/bim/helper.py +++ b/src/blenderbim/blenderbim/bim/helper.py @@ -130,7 +130,7 @@ def add_attribute_enum_items_descriptions(attribute_blender, enum_items): for enum_item in enum_items: new_enum_description = attribute_blender.enum_descriptions.add() try: - description = get_predefined_type_doc(version, attribute_blender.ifc_class, enum_item) + description = get_predefined_type_doc(version, attribute_blender.ifc_class, enum_item) or "" except KeyError: # TODO this only supports predefined type enums. Add support for other types of enums ? description = "" new_enum_description.name = description diff --git a/src/ifcopenshell-python/ifcopenshell/util/doc.py b/src/ifcopenshell-python/ifcopenshell/util/doc.py index d4ce546c0a..503e573453 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/doc.py +++ b/src/ifcopenshell-python/ifcopenshell/util/doc.py @@ -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 diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index 8f3ecbabf6..8915d205c8 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -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.