bim.assign_scene_units - expose operator to ui

This commit is contained in:
Andrej730
2025-06-25 10:40:58 +05:00
parent 6b6bf248ff
commit 00414a1590
2 changed files with 3 additions and 0 deletions
@@ -30,10 +30,12 @@ if TYPE_CHECKING:
class AssignSceneUnits(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.assign_scene_units"
bl_label = "Assign Scene Units"
bl_description = "Add new units based on the current Blender scene units and assign them as project default."
bl_options = {"REGISTER", "UNDO"}
def _execute(self, context):
core.assign_scene_units(tool.Ifc, tool.Unit)
core.load_units(tool.Unit)
class AssignUnit(bpy.types.Operator, tool.Ifc.Operator):
+1
View File
@@ -53,6 +53,7 @@ class BIM_PT_units(Panel):
row = self.layout.row(align=True)
row.label(text="{} Units Found".format(UnitsData.data["total_units"]), icon="SNAP_GRID")
if self.props.is_editing:
row.operator("bim.assign_scene_units", text="", icon="TOOL_SETTINGS")
row.operator("bim.disable_unit_editing_ui", text="", icon="CANCEL")
else:
row.operator("bim.load_units", text="", icon="GREASEPENCIL")