mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +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)
|
||||
categories = {}
|
||||
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():
|
||||
cat = props.materials.add()
|
||||
cat.name = category or ""
|
||||
|
||||
Reference in New Issue
Block a user