From 2ce4102f88e6940064cb18b5f1ff6ba70ea9bcf4 Mon Sep 17 00:00:00 2001 From: Youen Toupin Date: Sat, 11 Dec 2021 18:05:39 +0100 Subject: [PATCH] empty workbench --- .gitignore | 5 + Init.py | 2 + InitGui.py | 49 ++ ahb_locator.py | 0 resources/assembly-handbook.svg | 1018 +++++++++++++++++++++++++++++++ 5 files changed, 1074 insertions(+) create mode 100644 .gitignore create mode 100644 Init.py create mode 100644 InitGui.py create mode 100644 ahb_locator.py create mode 100644 resources/assembly-handbook.svg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..69810f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class diff --git a/Init.py b/Init.py new file mode 100644 index 0000000..e65e306 --- /dev/null +++ b/Init.py @@ -0,0 +1,2 @@ +import FreeCAD + diff --git a/InitGui.py b/InitGui.py new file mode 100644 index 0000000..5dae647 --- /dev/null +++ b/InitGui.py @@ -0,0 +1,49 @@ +import os +import FreeCADGui as Gui +import FreeCAD as App + +import ahb_locator + +global ahb_icon +ahb_icon = os.path.join(os.path.dirname(ahb_locator.__file__), "resources/assembly-handbook.svg") + +class AssemblyHandbookWorkbench(Gui.Workbench): + """ + class which gets initiated at startup of the gui + """ + + MenuText = "Assembly handbook" + ToolTip = "A workbench for automating creation of an assembly handbook" + Icon = ahb_icon + toolbox = [] + + def GetClassName(self): + return "Gui::PythonWorkbench" + + def Initialize(self): + """ + This function is called at the first activation of the workbench. + here is the place to import all the commands + """ + #from freecad.assembly_handbook import my_numpy_function + #App.Console.PrintMessage("switching to workbench_starterkit\n") + #App.Console.PrintMessage("run a numpy function: sqrt(100) = {}\n".format(my_numpy_function.my_foo(100))) + + self.appendToolbar("Tools", self.toolbox) + self.appendMenu("Tools", self.toolbox) + + def Activated(self): + """ + code which should be computed when a user switch to this workbench + """ + pass + + def Deactivated(self): + """ + code which should be computed when this workbench is deactivated + """ + pass + +Gui.addWorkbench(AssemblyHandbookWorkbench()) + +print("Assembly Handbook workbench GUI loaded") diff --git a/ahb_locator.py b/ahb_locator.py new file mode 100644 index 0000000..e69de29 diff --git a/resources/assembly-handbook.svg b/resources/assembly-handbook.svg new file mode 100644 index 0000000..6e0e3b7 --- /dev/null +++ b/resources/assembly-handbook.svg @@ -0,0 +1,1018 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [agryson] Alexander Gryson + + + http://agryson.net + + preferences-techdraw + 2016-01-19 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/TechDraw/Gui/Resources/icons/preferences-techdraw.svg + + + FreeCAD LGPL2+ + + + + + + [agryson] Alexander Gryson + + + [agryson] Alexander Gryson + + + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + + + + +