diff --git a/src/bonsai/bonsai/bim/module/drawing/ui.py b/src/bonsai/bonsai/bim/module/drawing/ui.py index 22a111cdc0..a6d742c54a 100644 --- a/src/bonsai/bonsai/bim/module/drawing/ui.py +++ b/src/bonsai/bonsai/bim/module/drawing/ui.py @@ -571,18 +571,6 @@ class BIM_PT_product_assignments(Panel): col.operator("bim.select_assigned_product", icon="RESTRICT_SELECT_OFF", text="") col.enabled = bool(ProductAssignmentsData.data["relating_product"]) - # Parametric dimension controls - element = tool.Ifc.get_entity(obj) - if element: - import ifcopenshell.util.element - ptype = ifcopenshell.util.element.get_predefined_type(element) - if ptype in ("DIMENSION", "RADIUS", "DIAMETER", "ANGLE", "PLAN_LEVEL", "SECTION_LEVEL"): - self.layout.separator() - self.layout.label(text="Parametric Dimension", icon="CONSTRAINT") - row = self.layout.row(align=True) - row.operator("bim.set_dimension_anchor", icon="PIVOT_CURSOR") - op = row.operator("bim.regenerate_dimensions", icon="FILE_REFRESH", text="Regenerate") - op.active_only = True diff --git a/src/bonsai/bonsai/bim/module/drawing/workspace.py b/src/bonsai/bonsai/bim/module/drawing/workspace.py index 7080ff05e5..146ba66520 100644 --- a/src/bonsai/bonsai/bim/module/drawing/workspace.py +++ b/src/bonsai/bonsai/bim/module/drawing/workspace.py @@ -250,6 +250,17 @@ class AnnotationToolUI: op = row.operator("bim.regenerate_dimensions", icon="FILE_REFRESH", text="Regenerate") op.active_only = True + obj = context.active_object + element = tool.Ifc.get_entity(obj) if obj else None + if element and element.is_a("IfcAnnotation"): + ptype = ifcopenshell.util.element.get_predefined_type(element) + if ptype in cls._DIMENSION_TYPES: + 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") + op.active_only = True + @classmethod def draw_type_selection_interface(cls): # shared by both sidebar and header