From d2d47efdd442390b3e158a1a53481b6caa656fb2 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sat, 16 May 2026 19:16:02 -0500 Subject: [PATCH] Add LinePosition: absolute dimension line placement gated on ForcePerpendicularToFace - BBIM_Dimension.LinePosition (IfcLengthMeasure): holds the dimension line at a fixed global coordinate along cross(world_Z, dim_direction), independent of geometry movement - regenerate_dimension applies LinePosition only when ForcePerpendicularToFace is also set (the two are semantically coupled); anchor["pt"] always stores the true surface hit so the measured length is unaffected - BIMAnnotationProperties.line_position uses get/set callbacks instead of an update callback to avoid the 'Writing to ID classes in this context is not allowed' error that fires when Blender draws the tool header - DimensionLinePositionWidget (BIM_GGT_dimension_line_position): gizmo group with two opposing GizmoCone handles at the curve midpoint; poll requires ForcePerpendicularToFace so the handles only appear when the feature is active - UI: line_position field and gizmo are hidden when ForcePerpendicularToFace is off - Psets_BBIM_Annotation.ifc: #40 LinePosition template added to BBIM_Dimension Co-Authored-By: Claude Sonnet 4.6 --- src/bonsai/bonsai/bim/module/drawing/workspace.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/drawing/workspace.py b/src/bonsai/bonsai/bim/module/drawing/workspace.py index 146ba66520..ee82a40184 100644 --- a/src/bonsai/bonsai/bim/module/drawing/workspace.py +++ b/src/bonsai/bonsai/bim/module/drawing/workspace.py @@ -256,6 +256,11 @@ class AnnotationToolUI: ptype = ifcopenshell.util.element.get_predefined_type(element) if ptype in cls._DIMENSION_TYPES: cls.layout.separator() + ann_props = tool.Drawing.get_annotation_props() + if ann_props.force_perpendicular_to_face: + row = cls.layout.row(align=True) + row.prop(ann_props, "line_position") + cls.layout.separator() row = cls.layout.row(align=True) row.operator("bim.set_dimension_anchor", icon="PIVOT_CURSOR") op = row.operator("bim.regenerate_dimensions", icon="FILE_REFRESH", text="Regenerate")