diff --git a/src/bonsai/bonsai/bim/helper.py b/src/bonsai/bonsai/bim/helper.py index f36b50291c..1ecef5a489 100644 --- a/src/bonsai/bonsai/bim/helper.py +++ b/src/bonsai/bonsai/bim/helper.py @@ -92,7 +92,7 @@ def draw_attribute( layout.prop( attribute, value_name, - text=attribute.name, + text=attribute.display_name, ) if attribute.is_uri: @@ -178,8 +178,11 @@ def import_attribute( elif data_type == "integer": new.int_value = 0 if new.is_null else int(data[attribute.name()]) elif data_type == "float": - if attribute.type_of_attribute()._is("IfcLengthMeasure"): + attribute_type = attribute.type_of_attribute() + if attribute_type._is("IfcLengthMeasure"): new.special_type = "LENGTH" + elif attribute_type._is("IfcForceMeasure"): + new.special_type = "FORCE" new.float_value = 0.0 if new.is_null else float(data[attribute.name()]) elif data_type == "enum": enum_items = ifcopenshell.util.attribute.get_enum_items(attribute) diff --git a/src/bonsai/bonsai/bim/prop.py b/src/bonsai/bonsai/bim/prop.py index 6f65744293..0d83a26bdd 100644 --- a/src/bonsai/bonsai/bim/prop.py +++ b/src/bonsai/bonsai/bim/prop.py @@ -275,6 +275,7 @@ def get_display_name(self: "Attribute") -> str: AttributeDataType = Literal["string", "integer", "float", "boolean", "enum", "file"] +AttributeSpecialType = Literal["", "DATE", "DATETIME", "LENGTH", "AREA", "VOLUME", "FORCE"] class Attribute(PropertyGroup): @@ -327,6 +328,7 @@ class Attribute(PropertyGroup): description: str ifc_class: str data_type: AttributeDataType + special_type: AttributeSpecialType def get_value(self) -> Union[str, float, int, bool, None]: if self.is_optional and self.is_null: