From 6c6d4c047cb93443069f37935641bde3a7425519 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 20 Aug 2021 08:50:57 +1000 Subject: [PATCH] Fix #1672. Bug where style attributes couldn't be edited. --- src/blenderbim/blenderbim/bim/helper.py | 2 +- src/ifcopenshell-python/ifcopenshell/util/attribute.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/helper.py b/src/blenderbim/blenderbim/bim/helper.py index 29bb267932..8b7dfc6c1d 100644 --- a/src/blenderbim/blenderbim/bim/helper.py +++ b/src/blenderbim/blenderbim/bim/helper.py @@ -53,7 +53,7 @@ def draw_attribute(attribute, layout, copy_operator=None): def import_attributes(ifc_class, props, data, callback=None): for attribute in IfcStore.get_schema().declaration_by_name(ifc_class).all_attributes(): data_type = ifcopenshell.util.attribute.get_primitive_type(attribute) - if data_type == "entity" or (isinstance(data_type, tuple) and "entity" in ".".join(data_type)): + if isinstance(data_type, tuple) or data_type == "entity": callback(attribute.name(), None, data) if callback else None continue new = props.add() diff --git a/src/ifcopenshell-python/ifcopenshell/util/attribute.py b/src/ifcopenshell-python/ifcopenshell/util/attribute.py index 5e56c62f2f..e874dff672 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/attribute.py +++ b/src/ifcopenshell-python/ifcopenshell/util/attribute.py @@ -3,10 +3,12 @@ def get_primitive_type(attribute_or_data_type): data_type = str(attribute_or_data_type.type_of_attribute()) else: data_type = str(attribute_or_data_type) - if "" in data_type: