mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 16:16:21 +00:00
Fix bug where material categories don't exist in IFC2X3
This commit is contained in:
@@ -65,7 +65,7 @@ class Material(blenderbim.core.tool.Material):
|
|||||||
materials = sorted(tool.Ifc.get().by_type(material_type), key=get_name)
|
materials = sorted(tool.Ifc.get().by_type(material_type), key=get_name)
|
||||||
categories = {}
|
categories = {}
|
||||||
if material_type == "IfcMaterial":
|
if material_type == "IfcMaterial":
|
||||||
[categories.setdefault(m.Category, []).append(m) for m in materials]
|
[categories.setdefault(getattr(m, "Category", "Uncategorised"), []).append(m) for m in materials]
|
||||||
for category, mats in categories.items():
|
for category, mats in categories.items():
|
||||||
cat = props.materials.add()
|
cat = props.materials.add()
|
||||||
cat.name = category or ""
|
cat.name = category or ""
|
||||||
|
|||||||
Reference in New Issue
Block a user