empty workbench

This commit is contained in:
Youen Toupin 2021-12-11 18:05:39 +01:00
parent 695005a66a
commit 2ce4102f88
5 changed files with 1074 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

2
Init.py Normal file
View File

@ -0,0 +1,2 @@
import FreeCAD

49
InitGui.py Normal file
View File

@ -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")

0
ahb_locator.py Normal file
View File

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 50 KiB