From 4c68ec6f82bbb5ed743d96ab5ef3b4f34e8f6674 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 6 Sep 2024 23:10:37 +1000 Subject: [PATCH] Fix bug where editing AxisTag didn't change the grid axis name --- src/bonsai/bonsai/bim/module/attribute/operator.py | 3 +++ src/bonsai/bonsai/bim/module/model/handler.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/attribute/operator.py b/src/bonsai/bonsai/bim/module/attribute/operator.py index 24102a66ef..e04addce81 100644 --- a/src/bonsai/bonsai/bim/module/attribute/operator.py +++ b/src/bonsai/bonsai/bim/module/attribute/operator.py @@ -107,6 +107,9 @@ class EditAttributes(bpy.types.Operator, tool.Ifc.Operator): attributes = bonsai.bim.helper.export_attributes(props.attributes, callback=callback) ifcopenshell.api.run("attribute.edit_attributes", self.file, product=product, attributes=attributes) + + if (name := tool.Loader.get_name(product)) and obj.name != name: + obj.name = name bpy.ops.bim.disable_editing_attributes(obj=obj.name) return {"FINISHED"} diff --git a/src/bonsai/bonsai/bim/module/model/handler.py b/src/bonsai/bonsai/bim/module/model/handler.py index 95a3190ab7..b73e276602 100644 --- a/src/bonsai/bonsai/bim/module/model/handler.py +++ b/src/bonsai/bonsai/bim/module/model/handler.py @@ -26,7 +26,6 @@ from bpy.app.handlers import persistent @persistent def load_post(*args): - ifcopenshell.api.add_pre_listener("attribute.edit_attributes", "Bonsai.Root.SyncName", root.sync_name) ifcopenshell.api.add_pre_listener("style.edit_presentation_style", "Bonsai.Root.SyncStyleName", root.sync_name) ifcopenshell.api.add_post_listener(