Browse Source

empty workbench

master
Youen Toupin 3 years ago
parent
commit
2ce4102f88
  1. 5
      .gitignore
  2. 2
      Init.py
  3. 49
      InitGui.py
  4. 0
      ahb_locator.py
  5. 1018
      resources/assembly-handbook.svg

5
.gitignore vendored

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

2
Init.py

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

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

0
ahb_locator.py

1018
resources/assembly-handbook.svg

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 50 KiB

Loading…
Cancel
Save