From 28219973f66e2cf84aad368cd8b278db1380573d Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sun, 15 Mar 2026 15:03:53 -0500 Subject: [PATCH] Fix manual section/elevation annotation placement in non-plan views Use get_default_annotation_matrix() for manual SECTION annotations so the object is placed in the camera's annotation plane with the correct rotation, matching how auto-generated section annotations are created. Without this, annotations placed in elevation or section camera views had identity rotation, causing the IFC representation to be in the wrong coordinate system and failing to tessellate. Also guard draw_edit_object_interface against non-IFC active objects to prevent AssertionError during toolbar redraws, and skip IFC item edit mode for ELEVATION/SECTION annotation types on placement. --- src/bonsai/bonsai/bim/module/drawing/operator.py | 5 ++++- src/bonsai/bonsai/bim/module/drawing/workspace.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index f9df38b268..64fe302de2 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -1898,7 +1898,10 @@ class AddAnnotation(bpy.types.Operator, tool.Ifc.Operator): drawing=drawing, object_type=props.object_type, relating_type=tool.Ifc.get().by_id(int(props.relating_type_id)) if props.relating_type_id != "0" else None, - enable_editing=True, + # ELEVATION/SECTION annotations use simple empty/line geometry that + # cannot be tessellated by the IFC geometry engine, so skip IFC + # item edit mode for these types. + enable_editing=object_type not in ("ELEVATION", "SECTION"), ) if props.object_type == "IMAGE": bpy.ops.bim.add_reference_image("INVOKE_DEFAULT", existing_object_by_name=obj.name) diff --git a/src/bonsai/bonsai/bim/module/drawing/workspace.py b/src/bonsai/bonsai/bim/module/drawing/workspace.py index 3710dfacb9..1d323af157 100644 --- a/src/bonsai/bonsai/bim/module/drawing/workspace.py +++ b/src/bonsai/bonsai/bim/module/drawing/workspace.py @@ -230,7 +230,8 @@ class AnnotationToolUI: @classmethod def draw_edit_object_interface(cls, context): - if DecoratorData.get_text_data(bpy.context.active_object): + obj = bpy.context.active_object + if tool.Ifc.get_entity(obj) and DecoratorData.get_text_data(obj): add_layout_hotkey_operator(cls.layout, "Edit Text", "S_E", "") if bpy.ops.bim.copy_annotation_to_drawing.poll(): row = cls.layout.row(align=True)