[SOLVED]how to copy a customised toolbar between workbenches

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

[SOLVED]how to copy a customised toolbar between workbenches

Post by piffpoof »

hello

I was wondering if there is some shortcut to copy a customised toolbar between workbenches?

Tools->Customize...
Toolbars tab

I have created a tool bar called "my new favourite toolbar" and populated it with various icons from various workbenches. After doing that I found it is associated with only a single workbench - "Part Design" workbench in my case - which is fine. But is there a way to copy it to the other workbenches or write it out and read it back into them, or something? Or do I need to re-define it in the other workbenches?

And on this topic, does anyone know why the Draft workbench does not appear on the list of "Tools in the Customize display? I wanted to put the "Clone" icon onto my customised toolbar.

thanks

OS: Mac OS X
Word size: 64-bit
Version: 0.14.3703 (Git)
Branch: releases/FreeCAD-0-14
Hash: c6edd47334a3e6f209e493773093db2b9b4f0e40
Python version: 2.7.5
Qt version: 4.8.6
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
Attachments
toolbar.jpg
toolbar.jpg (92.65 KiB) Viewed 2683 times
Last edited by piffpoof on Wed Dec 24, 2014 7:07 am, edited 1 time in total.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: how to copy a customised toolbar between workbenches

Post by wmayer »

I have created a tool bar called "my new favourite toolbar" and populated it with various icons from various workbenches. After doing that I found it is associated with only a single workbench - "Part Design" workbench in my case - which is fine. But is there a way to copy it to the other workbenches or write it out and read it back into them, or something? Or do I need to re-define it in the other workbenches?
Currently it's not supported to share custom toolbars with several workbenches. But it's possible to just duplicate existing custom toolbars. Therefore go to Tools > Edit parameters.

On the left navigate to the path BaseApp > Workbench > "Name of the workbench" > Toolbar. Now select the item "Toolbar" (not its sub-element!) and in the context-menu go to Export parameter. Save it to a fcparam file and now go to the Toolbar of the workbench for which you want to duplicate the custom toolbar. Now import the above fcparam file and you are done.
And on this topic, does anyone know why the Draft workbench does not appear on the list of "Tools in the Customize display? I wanted to put the "Clone" icon onto my customised toolbar.
Did you load the Draft workbench? In the customize dialog only commands of already loaded workbenches can be shown. This fact also affects your custom toolbar after a restart of FreCAD: if you add commands of a workbench which isn't loaded when the workbench with the custom toolbar is loaded these commands cannot be added.
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: how to copy a customised toolbar between workbenches

Post by rockn »

piffpoof wrote:And on this topic, does anyone know why the Draft workbench does not appear on the list of "Tools in the Customize display? I wanted to put the "Clone" icon onto my customised toolbar.
Hi,
It's in the Python list.
Formations - Assistance - Développement : https://freecad-france.com
mario52
Veteran
Posts: 4674
Joined: Wed May 16, 2012 2:13 pm

Re: how to copy a customised toolbar between workbenches

Post by mario52 »

Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: how to copy a customised toolbar between workbenches

Post by piffpoof »

But it's possible to just duplicate existing custom toolbars. Therefore go to Tools > Edit parameters.

On the left navigate to the path BaseApp > Workbench > "Name of the workbench" > Toolbar. Now select the item "Toolbar" (not its sub-element!) and in the context-menu go to Export parameter. Save it to a fcparam file and now go to the Toolbar of the workbench for which you want to duplicate the custom toolbar. Now import the above fcparam file and you are done.
Thanks for that, it works perfectly. And I don't think I would have guessed where the solution lay in 1,001 nights.
Did you load the Draft workbench? In the customize dialog only commands of already loaded workbenches can be shown. This fact also affects your custom toolbar after a restart of FreCAD: if you add commands of a workbench which isn't loaded when the workbench with the custom toolbar is loaded these commands cannot be added.
I was in the Draft workbench when I tried this as I wanted to make sure I got the correct icon - I'm trying to add the Clone icon to my custom toolbar. I've attached a screen snapshot with the pop-up menu I get which does not list the Draft workbench, it also shows the Draft workbench in the background.

thanks

Dean
Attachments
draftWbLoaded.jpg
draftWbLoaded.jpg (111.53 KiB) Viewed 2657 times
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: how to copy a customised toolbar between workbenches

Post by piffpoof »

rockn wrote:
piffpoof wrote:And on this topic, does anyone know why the Draft workbench does not appear on the list of "Tools in the Customize display? I wanted to put the "Clone" icon onto my customised toolbar.
Hi,
It's in the Python list.
Pardon my ignorance, but which "Python" list? I searched "FreeCAD python API documentation" located at http://www.freecadweb.org/api/ for the keyword "navigation" (which was the best I could come up with) but got no hits.

thanks
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: how to copy a customised toolbar between workbenches

Post by rockn »

Right top of Part Design in the screencapture you made. ;)
Formations - Assistance - Développement : https://freecad-france.com
User avatar
piffpoof
Posts: 346
Joined: Sun Nov 30, 2014 11:00 am
Location: Mare Nostrum
Contact:

Re: how to copy a customised toolbar between workbenches

Post by piffpoof »

rockn wrote:Right top of Part Design in the screencapture you made. ;)
hi, maybe we're talking at cross purposes here...

I know where to find the icon within the toolbar on the Draft workbench in order to use it, what I am unable to locate is the icon (or the workbench called "Draft") when I am in the customize toolbar window. It just doesn't seem to be visible (within the list from which you choose the icons from, which is selected using the pop-up menu immediately above it). If it were visible in the lefthand list then I could select it, click the arrow pointing to the right and copy it onto my custom toobar.

My goal here is to be able to add it to my custom toolbar which I can then have available in the workbenches I use frequently. So I would then have the Clone icon available within the Parts workbench - for example.

thanks

Dean
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: how to copy a customised toolbar between workbenches

Post by wmayer »

I know where to find the icon within the toolbar on the Draft workbench in order to use it, what I am unable to locate is the icon (or the workbench called "Draft") when I am in the customize toolbar window. It just doesn't seem to be visible (within the list from which you choose the icons from, which is selected using the pop-up menu immediately above it). If it were visible in the lefthand list then I could select it, click the arrow pointing to the right and copy it onto my custom toobar.
You misunderstood him. The Draft workbench is entirely written in Python and thus the internal group name of the command is called "Python". So, switch to the category "Python" on the left side then you'll find the Draft commands. Since this is a bit misleading we should make sure that (Python) commands are sorted by the workbench they belong to.
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: how to copy a customised toolbar between workbenches

Post by rockn »

Yes maybe, English is not my first langage.

But I understand you want Draft Clone tool button in Part Design workbench.
Personalize.png
Personalize.png (50.14 KiB) Viewed 2630 times
Is it ? I can explain more if needed.
Formations - Assistance - Développement : https://freecad-france.com
Post Reply