Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F56613213
init_gui.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Mar 29, 11:49
Size
1 KB
Mime Type
text/x-python
Expires
Sun, Mar 31, 12:49 (2 d)
Engine
blob
Format
Raw Data
Handle
16721090
Attached To
R8831 BIMxBEM
init_gui.py
View Options
import
os
import
sys
import
FreeCADGui
as
Gui
import
FreeCAD
as
App
from
freecad.bem
import
ICONPATH
class
BIMxBEM
(
Gui
.
Workbench
):
"""
class which gets initiated at starup of the gui
"""
MenuText
=
"BIMxBEM"
ToolTip
=
"a simple template workbench"
Icon
=
os
.
path
.
join
(
ICONPATH
,
"template_resource.svg"
)
toolbox
=
[
"Import"
,
"Generate SIA"
,
"DisplaySIAInt"
,
"DisplaySIAExt"
,
"DisplayAll"
]
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
"""
sys
.
path
.
append
(
"/home/cyril/git/BIMxBEM"
)
from
freecad.bem
import
commands
App
.
Console
.
PrintMessage
(
"switching to BIMxBEM workbench"
)
self
.
appendToolbar
(
"Tools"
,
self
.
toolbox
)
self
.
appendMenu
(
"Tools"
,
self
.
toolbox
)
Gui
.
addCommand
(
"Import"
,
commands
.
ImportRelSpaceBoundary
())
Gui
.
addCommand
(
"Generate SIA"
,
commands
.
GenerateBemBoundaries
())
Gui
.
addCommand
(
"DisplaySIAInt"
,
commands
.
DisplaySIAInt
())
Gui
.
addCommand
(
"DisplaySIAExt"
,
commands
.
DisplaySIAExt
())
Gui
.
addCommand
(
"DisplayAll"
,
commands
.
DisplayAll
())
def
reload
(
self
):
from
importlib
import
reload
from
freecad.bem
import
commands
reload
(
commands
)
App
.
Console
.
PrintMessage
(
"Reloading BIMxBEM workbench"
)
self
.
appendToolbar
(
"Tools"
,
self
.
toolbox
)
self
.
appendMenu
(
"Tools"
,
self
.
toolbox
)
Gui
.
addCommand
(
"Import"
,
commands
.
ImportRelSpaceBoundary
())
Gui
.
addCommand
(
"Generate SIA"
,
commands
.
GenerateBemBoundaries
())
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
(
BIMxBEM
())
Event Timeline
Log In to Comment