framework/freecad_workbench/InitGui.py
2024-04-14 18:54:47 +00:00

82 lines
2.8 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2023 by brothermechanic. All Rights Reserved.
# Based on ARBench by github/mahaarbo
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
__title__='Frames Workbench'
__author__ = 'brothermechanic'
__copyright__ = 'Copyright (c) 2023 brothermechanic'
__license__ = 'GPL-2.1'
__version__ = "0.1"
__email__ = 'brothermechanic@gmail.com'
__url__ = ["https://robossembler.org"]
__status__ = 'development'
class Frames(Workbench):
MenuText = "Frames"
ToolTip = "Frames Workbench"
Icon = """"""
def __init__(self):
import os
self.Icon = os.path.join(FreeCAD.getUserAppDataDir(), "Mod",
__class__.__name__, "UI", "icons", "frame.svg")
def Initialize(self):
"""This function is executed when FreeCAD starts"""
import Frames
self.framecommands = [
"BoMGeneration",
"FrameCommand",
"SelectedPartFrameCommand",
"AllPartFramesCommand",
"FeatureFrameCommand"
]
self.toolcommands = [
"ExportPlacementAndPropertiesCommand",
"Export_Entities",
"ExportGazeboModels",
"InsertGraspPose",
"ASM4StructureParsing",
"PDDL_CreateTypes",
"PDDL_CreateParameters",
"PDDL_CreateAction",
"PDDL_CreatePredicate",
"PDDL_CreateDurativeAction",
"Publish_Project"
]
self.appendToolbar(f"{__class__.__name__} Frames", self.framecommands)
self.appendToolbar(f"{__class__.__name__} Tools", self.toolcommands)
def Activated(self):
"""This function is executed when the workbench is activated."""
#
return
def Deactivated(self):
"""This function is executed when the workbench is deactivated."""
#
return
def ContextMenu(self, recipient):
"""This is execcuted whenever the user right-clicks on screen."""
pass
def GetClassName(self):
# This function is mandatory if this is a full python workbench
return "Gui::PythonWorkbench"
Gui.addWorkbench(Frames())