From 93e4827198d77eab51dd0b7e5e584a6e55700671 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Mon, 25 Jan 2016 00:15:23 +0300 Subject: [PATCH] Group Inspect and ShapeInfo into a dropdown button --- InitGui.py | 1 - lattice2Inspect.py | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/InitGui.py b/InitGui.py index 1a32ca2..1b1be38 100644 --- a/InitGui.py +++ b/InitGui.py @@ -78,7 +78,6 @@ class Lattice2Workbench (Workbench): cmdsGuiTools = ([] + Lattice2.GuiTools.Inspect.exportedCommands - + Lattice2.CompoundFeatures.ShapeInfoFeature.exportedCommands + Lattice2.GuiTools.SubstituteObject.exportedCommands + Lattice2.GuiTools.ExposeLinkSub.exportedCommands ) diff --git a/lattice2Inspect.py b/lattice2Inspect.py index 51932fe..c90de4c 100644 --- a/lattice2Inspect.py +++ b/lattice2Inspect.py @@ -134,5 +134,22 @@ class _CommandInspect: FreeCADGui.addCommand('Lattice2_Inspect',_CommandInspect()) -exportedCommands = ['Lattice2_Inspect'] +import lattice2ShapeInfoFeature + +class GroupCommandInspect: + def GetCommands(self): + return ('Lattice2_Inspect', lattice2ShapeInfoFeature.exportedCommands[0]) # a tuple of command names that you want to group + + def GetDefaultCommand(self): # return the index of the tuple of the default command. This method is optional and when not implemented '0' is used + return 0 + + def GetResources(self): + return { 'MenuText': 'Inspect:', 'ToolTip': 'Inspect: tools to analyze shape structure.'} + + def IsActive(self): # optional + return True + +FreeCADGui.addCommand('Lattice2_Inspect_GroupCommand',GroupCommandInspect()) + +exportedCommands = ['Lattice2_Inspect_GroupCommand']