How to activate cpp workbench in initgui.py file ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
orhan.esn
Posts: 1
Joined: Fri Sep 21, 2018 5:16 pm

How to activate cpp workbench in initgui.py file ?

Post by orhan.esn »

I am new in freecad development and I want to create a module that runs with app and gui part to be able to code in c++. I created it with build tool fcbt.py and it coppied files to mode directory. I copied those files to mode directory where build files located. Now when I launched to freecad it appears in combobox but shows error mymodulegui not found ! I created it in mymodule directory as mymodulegui.py and it does'nt show any error but workbench dont't activating. I want to learn I have a app and gui part in my modulu and how to configure initgui.py file to my workbench in gui and work with c++ coding.
This is my initgui.py file:

Code: Select all

# MyModule gui init module
# (c) 2001 Juergen Riegel LGPL

class MyModuleWorkbench ( Workbench ):
	"MyModule workbench object"
	MenuText = "MyModule"
	ToolTip = "MyModule workbench"
	def Initialize(self):
		# load the module
		import MyModuleGui
		Log ("Loading MyModule... done\n")
		
	def GetClassName(self):
		return "MyModuleGui::MyModuleWorkbench"

Gui.addWorkbench(MyModuleWorkbench())
Post Reply