Tool Addition to Workbench

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Zig_mint
Posts: 12
Joined: Thu Jan 10, 2019 5:48 pm

Tool Addition to Workbench

Postby Zig_mint » Sun Feb 10, 2019 8:13 pm

Hi,
I am trying to make a custom workbench for myself that contains all the tools that I use regularly. I have created a module using the FreeCad build tool and its all working fine.

I wanted to know, how will I add already established tools of freecad?

for instance, I want my workbench to contain rectangle and circle sketching tools, How do I go about doing that?
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Tool Addition to Workbench

Postby microelly2 » Mon Feb 11, 2019 10:07 am

You can load the moduls you want into your InitGui.py

Code: Select all


try: # some methods from curve wb
			import ZebraTool
			import ParametricComb
			import GeomInfo
except: pass

cmds= ['ZebraTool','ParametricComb','GeomInfo','Nurbs_DraftBSpline Editor',
		'Nurbs_Create Shoe','Nurbs_Create Sole','Nurbs_Sole Change Model',
		# ....
		]
 #create your menu with the imported methods and your own m
self.appendMenu("Nurbs", cmds)

You only need to know the names of the commands you want.
Zig_mint
Posts: 12
Joined: Thu Jan 10, 2019 5:48 pm

Re: Tool Addition to Workbench

Postby Zig_mint » Mon Feb 11, 2019 4:31 pm

Thanks for the help but I wanted to specifically understand how can I import the "line tool" as the "Draft" and "Sketcher" workbench does.
GeneFC
Posts: 1577
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Tool Addition to Workbench

Postby GeneFC » Mon Feb 11, 2019 7:13 pm

There is a wiki page that explains all the details.

https://freecadweb.org/wiki/Customize_Toolbars

Gene