Skip to content

chbergmann/PythonWorkbenchTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Workbench Template

WorkbenchIcon

A template for creating a new FreeCAD workbench in Python.
FreeCAD offers great opportunities to create scripted objects. This should be a starting point to create your own workbench.

Installation

Automatic Installation

Note: This is the recommended way to install this workbench.
The Python Workbench Template will be available soon through the builtin FreeCAD Addon Manager. Once installed all that is needed is to restart FreeCAD and the workbench will be available in the workbench dropdown list menu.

Manual Installation

cd ~/FreeCAD/Mod/ 
git clone https://github.com/chbergmann/PythonWorkbenchTemplate.git

When you restart FreeCAD, "Python Workbench Template" workbench should now show up in the workbench dropdown list.

Getting started with a new FreeCAD workbench

  • Create a new git repository and copy the contents of this project to your new project
  • Rename PythonWorkbenchTemplate.py to YourWorkbenchsName.py. Search all files for PythonWorkbenchTemplate and replace with the name of your workbench
  • Rename Feature1.py with YourNewFeature.py
  • Edit InitGui.py. Delete Feature1 and add your new feature instead. Edit the _title_, _author_, _url_ and _version_ tags.
  • Write your new feature and test it well.
  • If you need a user interface, create a .ui file with the QT Designer. See Feature1TaskPanel in Feature1.py how to implement it.
  • Write a documentation in README.md. Explain the purpose of your workbench. Explain your features and its parameters. Screenshots are great.
  • Draw a .svg icon for the workbench and for each feature. You can export FreeCAD designs to .svg.
  • Announce your workbench in the FreeCAD forum. Add the link of your new thread in README.md
  • Add your workbench to the Addon manager

Tools

Feature1Icon Feature1

Creates a copy of a selected object and sets it on top of the original and colorizes it red or green. For demonstration how to write a workbench feature.

Parameters

  • Base: The object to colorize
  • Green: if True, the linked object will be colored green, otherwise red.

Discussion

Please offer feedback or connect with the developer via the dedicated FreeCAD forum thread.

License

GNU Lesser General Public License v3.0

About

A template for creating a new FreeCAD workbench in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages