mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
Move dimension anchor/regen buttons to annotation tool; ForcePerpendicularToFace toggle updates selection
workspace.py: - Move "Set Dimension Anchor" and "Regenerate" buttons from the properties panel (ui.py) into draw_edit_object_interface in the annotation tool, visible whenever a selected object is a dimension-type IfcAnnotation - Change force_perpendicular_to_face from a push-button (toggle=True) to a standard checkbox for clearer on/off state ui.py: - Remove the "Parametric Dimension" section (now lives in the tool header) prop.py: - Add _update_force_perpendicular update callback: when the checkbox is toggled, iterates all selected dimension annotations, writes the new ForcePerpendicularToFace value to each BBIM_Dimension pset, and calls regenerate_dimension so the constraint is applied immediately Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user