mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
bim.assign_scene_units - expose operator to ui
This commit is contained in:
@@ -30,10 +30,12 @@ if TYPE_CHECKING:
|
|||||||
class AssignSceneUnits(bpy.types.Operator, tool.Ifc.Operator):
|
class AssignSceneUnits(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.assign_scene_units"
|
bl_idname = "bim.assign_scene_units"
|
||||||
bl_label = "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"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
core.assign_scene_units(tool.Ifc, tool.Unit)
|
core.assign_scene_units(tool.Ifc, tool.Unit)
|
||||||
|
core.load_units(tool.Unit)
|
||||||
|
|
||||||
|
|
||||||
class AssignUnit(bpy.types.Operator, tool.Ifc.Operator):
|
class AssignUnit(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class BIM_PT_units(Panel):
|
|||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="{} Units Found".format(UnitsData.data["total_units"]), icon="SNAP_GRID")
|
row.label(text="{} Units Found".format(UnitsData.data["total_units"]), icon="SNAP_GRID")
|
||||||
if self.props.is_editing:
|
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")
|
row.operator("bim.disable_unit_editing_ui", text="", icon="CANCEL")
|
||||||
else:
|
else:
|
||||||
row.operator("bim.load_units", text="", icon="GREASEPENCIL")
|
row.operator("bim.load_units", text="", icon="GREASEPENCIL")
|
||||||
|
|||||||
Reference in New Issue
Block a user