Hide specific toolbar buttons!!!!

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
oscarchan
Posts: 47
Joined: Mon Apr 11, 2022 2:04 am

Hide specific toolbar buttons!!!!

Post by oscarchan »

Hi guys!

I am using FreeCAD 0.20 (windows).

1. I want to hide some specific toolbar buttons of different workbench to make the interface cleaner. Is it there a way I can do it through python code?
2. I want to add some frequently-used toolbar buttons from different workbench on my self-created workbench. How can I do that?
Thank you!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Hide specific toolbar buttons!!!!

Post by openBrain »

oscarchan wrote: Tue Aug 02, 2022 7:30 am 1. I want to hide some specific toolbar buttons of different workbench to make the interface cleaner. Is it there a way I can do it through python code?

Code: Select all

Gui.Command.get('COMMAND_NAME').getAction()[0].setVisible(False)
2. I want to add some frequently-used toolbar buttons from different workbench on my self-created workbench. How can I do that?
https://wiki.freecadweb.org/Interface_C ... n#Toolbars
oscarchan
Posts: 47
Joined: Mon Apr 11, 2022 2:04 am

Re: Hide specific toolbar buttons!!!!

Post by oscarchan »

Thank you so much for your reply!!

Code: Select all

Gui.Command.get('COMMAND_NAME').getAction()[0].setVisible(False)
Thanks. It works the way I expected!
I know this way. Is it possible for me to do it through user.cfg or python code ? (eg: using 'appendToolbar' method)
Thank you!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Hide specific toolbar buttons!!!!

Post by openBrain »

oscarchan wrote: Wed Aug 03, 2022 5:56 am I know this way. Is it possible for me to do it through user.cfg or python code ? (eg: using 'appendToolbar' method)
Don't know actually. Looks not so obvious.
oscarchan
Posts: 47
Joined: Mon Apr 11, 2022 2:04 am

Re: Hide specific toolbar buttons!!!!

Post by oscarchan »

Thanks!
Thank you!
Post Reply