From 09b4681413ac5dcaf35ffb6c1a2dec2f26495e39 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 23 Dec 2024 11:35:43 +0500 Subject: [PATCH] Fix #5892 By accident not commited `attr = context.button_pointer` line that was leading to console errors --- src/bonsai/bonsai/bim/ui.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bonsai/bonsai/bim/ui.py b/src/bonsai/bonsai/bim/ui.py index 69d2f8fb64..02fed5086b 100644 --- a/src/bonsai/bonsai/bim/ui.py +++ b/src/bonsai/bonsai/bim/ui.py @@ -1139,13 +1139,14 @@ def draw_custom_context_menu(self: bpy.types.Menu, context: bpy.types.Context) - layout = self.layout if isinstance(context.button_pointer, Attribute): - description = getattr(context.button_pointer, "description", None) - ifc_class = getattr(context.button_pointer, "ifc_class", "") + attr = context.button_pointer + description = attr.description + ifc_class = attr.ifc_class if ifc_class: try: - url = get_entity_doc(version, context.button_pointer.ifc_class).get("spec_url", "") + url = get_entity_doc(version, ifc_class).get("spec_url", "") except RuntimeError: # It's not an Entity Attribute. Let's try a Property Set attribute. - doc = get_property_set_doc(version, context.button_pointer.ifc_class) + doc = get_property_set_doc(version, ifc_class) if doc: url = doc.get("spec_url", "") else: # It's a custom property set. No URL available