add Help commands and bundled tutorial in pdf
This commit is contained in:
parent
557cd36e7d
commit
c35c2ed389
BIN
ExampleProjects/Lattice2 workbench basic tutorial.pdf
Normal file
BIN
ExampleProjects/Lattice2 workbench basic tutorial.pdf
Normal file
Binary file not shown.
|
@ -46,6 +46,11 @@ class Lattice2Workbench (Workbench):
|
||||||
|
|
||||||
def Initialize(self):
|
def Initialize(self):
|
||||||
|
|
||||||
|
import lattice2HelpCommands
|
||||||
|
|
||||||
|
cmdsHelp = lattice2HelpCommands.exportedCommands
|
||||||
|
self.appendMenu('Lattice2', cmdsHelp + ['Separator'])
|
||||||
|
|
||||||
import Lattice2
|
import Lattice2
|
||||||
cmdsArrayTools = ([]
|
cmdsArrayTools = ([]
|
||||||
+ Lattice2.ArrayFeatures.Placement.exportedCommands
|
+ Lattice2.ArrayFeatures.Placement.exportedCommands
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource>
|
<qresource>
|
||||||
|
<file>icons/Lattice2.svg</file>
|
||||||
<file>icons/Lattice2_ArrayFilter.svg</file>
|
<file>icons/Lattice2_ArrayFilter.svg</file>
|
||||||
<file>icons/Lattice2_ArrayFromShape.svg</file>
|
<file>icons/Lattice2_ArrayFromShape.svg</file>
|
||||||
<file>icons/Lattice2_AttachablePlacement.svg</file>
|
<file>icons/Lattice2_AttachablePlacement.svg</file>
|
||||||
|
|
47
lattice2HelpCommands.py
Normal file
47
lattice2HelpCommands.py
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
import FreeCADGui
|
||||||
|
from lattice2Common import *
|
||||||
|
|
||||||
|
class CommandBasicTutorial:
|
||||||
|
"opens basic tutorial"
|
||||||
|
def GetResources(self):
|
||||||
|
return {'Pixmap' : getIconPath("Lattice2.svg"),
|
||||||
|
'MenuText': "Help! Basic tutorial",
|
||||||
|
'ToolTip': "Open basic tutorial (available offline)"}
|
||||||
|
|
||||||
|
def Activated(self):
|
||||||
|
try:
|
||||||
|
import os
|
||||||
|
import lattice2Dummy
|
||||||
|
tutorial_pdf = os.path.dirname(lattice2Dummy.__file__) + "/ExampleProjects/Lattice2 workbench basic tutorial.pdf".replace("/", os.path.sep)
|
||||||
|
|
||||||
|
import webbrowser
|
||||||
|
webbrowser.open(tutorial_pdf)
|
||||||
|
except Exception as err:
|
||||||
|
msgError(err)
|
||||||
|
|
||||||
|
def IsActive(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
FreeCADGui.addCommand('Lattice2_Help_BasicTutorial', CommandBasicTutorial())
|
||||||
|
|
||||||
|
|
||||||
|
class CommandOpenManual:
|
||||||
|
"opens wiki"
|
||||||
|
def GetResources(self):
|
||||||
|
return {'Pixmap' : getIconPath("Lattice2.svg"),
|
||||||
|
'MenuText': "Help! Open Wiki",
|
||||||
|
'ToolTip': "Open Lattice2 documentation (on the web)"}
|
||||||
|
|
||||||
|
def Activated(self):
|
||||||
|
try:
|
||||||
|
import webbrowser
|
||||||
|
webbrowser.open('https://github.com/DeepSOIC/Lattice2/wiki')
|
||||||
|
except Exception as err:
|
||||||
|
msgError(err)
|
||||||
|
|
||||||
|
def IsActive(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
FreeCADGui.addCommand('Lattice2_Help_OpenManual', CommandOpenManual())
|
||||||
|
|
||||||
|
exportedCommands = ['Lattice2_Help_BasicTutorial', 'Lattice2_Help_OpenManual']
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user