Fix bug where spatial object may not exist when renaming from the spatial tree (e.g. partial loads), and also refresh UI (to see updated attributes)

This commit is contained in:
Dion Moult
2025-01-30 17:07:57 +11:00
parent 1768026891
commit 15d43e9166
+5 -1
View File
@@ -62,7 +62,11 @@ def update_elevation(self, context):
def update_name(self: "BIMContainer", context: bpy.types.Context) -> None:
if ifc_definition_id := self.ifc_definition_id:
tool.Ifc.get_object(tool.Ifc.get().by_id(ifc_definition_id)).name = self.name
element = tool.Ifc.get().by_id(ifc_definition_id)
tool.Spatial.edit_container_name(element, self.name)
if obj := tool.Ifc.get_object(element):
obj.name = tool.Loader.get_name(element)
bonsai.bim.handler.refresh_ui_data()
def update_active_container_index(self: "BIMSpatialDecompositionProperties", context: bpy.types.Context) -> None: