diff --git a/src/bonsai/bonsai/bim/module/profile/operator.py b/src/bonsai/bonsai/bim/module/profile/operator.py index cb7cd27491..38eb3cba20 100644 --- a/src/bonsai/bonsai/bim/module/profile/operator.py +++ b/src/bonsai/bonsai/bim/module/profile/operator.py @@ -42,7 +42,7 @@ class LoadProfiles(bpy.types.Operator): continue new = props.profiles.add() new.ifc_definition_id = profile.id() - new.name = profile.ProfileName or "Unnamed" + new["name"] = profile.ProfileName or "Unnamed" new.ifc_class = profile.is_a() props.is_editing = True diff --git a/src/bonsai/bonsai/tool/material.py b/src/bonsai/bonsai/tool/material.py index 2a12af77e5..c69bb49ea7 100644 --- a/src/bonsai/bonsai/tool/material.py +++ b/src/bonsai/bonsai/tool/material.py @@ -105,7 +105,7 @@ class Material(bonsai.core.tool.Material): for category, mats in categories.items(): cat = props.materials.add() - cat.name = category + cat["name"] = category cat.is_category = True cat.is_expanded = cat.name in expanded_categories @@ -114,8 +114,7 @@ class Material(bonsai.core.tool.Material): for material in mats if cat.is_expanded else []: new = props.materials.add() - # Assign name before assigning ifc_definition_id to avoid triggering IFC update. - new.name = get_name(material) + new["name"] = get_name(material) new.ifc_definition_id = material.id() new.total_elements = len( ifcopenshell.util.element.get_elements_by_material(tool.Ifc.get(), material) @@ -127,8 +126,7 @@ class Material(bonsai.core.tool.Material): return for material in materials: new = props.materials.add() - # Assign name before assigning ifc_definition_id to avoid triggering IFC update. - new.name = get_name(material) + new["name"] = get_name(material) new.ifc_definition_id = material.id() new.total_elements = len(ifcopenshell.util.element.get_elements_by_material(tool.Ifc.get(), material)) diff --git a/src/bonsai/bonsai/tool/spatial.py b/src/bonsai/bonsai/tool/spatial.py index b9c7e5e3ce..4d301f7068 100644 --- a/src/bonsai/bonsai/tool/spatial.py +++ b/src/bonsai/bonsai/tool/spatial.py @@ -448,12 +448,11 @@ class Spatial(bonsai.core.tool.Spatial): props = bpy.context.scene.BIMSpatialDecompositionProperties new = props.containers.add() new.ifc_class = element.is_a() - new.name = element.Name or "Unnamed" + new["name"] = element.Name or "Unnamed" new.description = element.Description or "" new.long_name = element.LongName or "" if not element.is_a("IfcProject"): - ifc_file = tool.Ifc.get() - new.elevation = str(ifcopenshell.util.placement.get_storey_elevation(element)) + new["elevation"] = str(ifcopenshell.util.placement.get_storey_elevation(element)) new.is_expanded = element.id() not in cls.contracted_containers new.level_index = level_index children = ifcopenshell.util.element.get_parts(element)