mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 05:22:06 +00:00
@@ -273,12 +273,16 @@ def set_length_value(self: "Attribute", value: float) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def get_display_name(self: "Attribute") -> str:
|
def get_display_name(self: "Attribute") -> str:
|
||||||
|
DISPLAY_UNIT_TYPES = ("AREA", "VOLUME", "FORCE")
|
||||||
name = self.name
|
name = self.name
|
||||||
if not self.special_type or self.special_type == "LENGTH":
|
if not self.special_type or self.special_type not in DISPLAY_UNIT_TYPES:
|
||||||
return name
|
return name
|
||||||
|
|
||||||
unit_type = f"{self.special_type}UNIT"
|
unit_type = f"{self.special_type}UNIT"
|
||||||
project_unit = ifcopenshell.util.unit.get_project_unit(tool.Ifc.get(), unit_type)
|
project_unit = ifcopenshell.util.unit.get_project_unit(tool.Ifc.get(), unit_type)
|
||||||
|
if not project_unit:
|
||||||
|
return name
|
||||||
|
|
||||||
unit_symbol = ifcopenshell.util.unit.get_unit_symbol(project_unit)
|
unit_symbol = ifcopenshell.util.unit.get_unit_symbol(project_unit)
|
||||||
return f"{name}, {unit_symbol}"
|
return f"{name}, {unit_symbol}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user