FreeCAD Academy

Demo : Extend Toolbar

This demo shows how to extend an existing toolbar.


Result

The demo code will add a new command into the File toolbar that when activated, will log a debug message.


Code

Source
└─ Manipulator.py   - Manipulator that modifies an existing toolbar.
└─ init_gui.py      - Setup code for creating and registering stuff.
└─ Command.py       - Command that logs a message on activation.


Pitfalls

Toolbars don’t have Ids, they are addressed only by their name, this is problematic because names may change and thus break your code.

Depending on the toolbar you may have to specify a different names for different versions of FreeCAD.