mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
reuse get_material_name
This commit is contained in:
@@ -368,11 +368,11 @@ class ObjectMaterialData:
|
|||||||
material = ifcopenshell.util.element.get_material(element_type)
|
material = ifcopenshell.util.element.get_material(element_type)
|
||||||
if not material:
|
if not material:
|
||||||
return
|
return
|
||||||
if material.is_a() in ("IfcMaterialLayerSetUsage", "IfcMaterialLayerSet"):
|
ifc_class = material.is_a()
|
||||||
name_attr = "LayerSetName"
|
# Are there really usages in types?
|
||||||
else:
|
if "Usage" in ifc_class:
|
||||||
name_attr = "Name"
|
return "Unnamed"
|
||||||
return getattr(material, name_attr, "Unnamed") or "Unnamed"
|
return tool.Material.get_material_name(material) or "Unnamed"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def material_type(cls):
|
def material_type(cls):
|
||||||
|
|||||||
Reference in New Issue
Block a user