[Macro] Bit of help for super users :)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Macro] Bit of help for super users :)
Hi all,
Goal of this was to have a macro that can offer some tools to ease life of "super users" that use FC in a non-conventional way (diagnose files posted on the forum, write some python routines to solve issues, ...).
ATM this is very basic. It creates a set of buttons located at the far right of the status bar. Usage will be easily described by the below picture : Another feature is to add on all dock widgets a slider that changes font size. The slider appears when a middle click is done on the widget status bar, then disappeared automatically when no action is performed. Below a dummy screencast to demonstrate : It is now really not polished (no comment in the code, no check to prevent exceptions, ...) but I posted it in this alpha state to get feedback about if some others also find it useful, and what features can be added to improve it.
EDIT : 2019/11/29 : Tree view is handled + right click can be used instead of middle click / Picture above not updated
EDIT : 2019/11/29 : Add imports of FreeCAD & FreeCADGui to be sure they are loaded
EDIT : 2019/11/30 : File extension is now '.py' and internal 'run()' function is available to programmatically run it
EDIT : 2019/12/01 : Add auto startup version as ZIP file. To be unzipped in the user 'Mod' folder (keep the including subfolder)
EDIT : 2019/12/04 : Add new tool that allow to change font size in dock widgets
EDIT : 2019/12/05 : Add helper to get full FC info as middle click on the 'C' Combo View toggler
EDIT : 2019/12/08 : Add the visibility 'V' tool / Description here to be updated (in between, please look at same date post in this thread)
EDIT : 2019/12/11 : Fix a PySide compatibility issue with FC 0.18 version
EDIT : 2019/12/13 : Update above description picture
EDIT : 2019/12/29 : Some fixes + increasing classes flexibility + adding new widget type to toggle boolean parameter
EDIT : 2020/01/01 : Bugfix (x2)
Goal of this was to have a macro that can offer some tools to ease life of "super users" that use FC in a non-conventional way (diagnose files posted on the forum, write some python routines to solve issues, ...).
ATM this is very basic. It creates a set of buttons located at the far right of the status bar. Usage will be easily described by the below picture : Another feature is to add on all dock widgets a slider that changes font size. The slider appears when a middle click is done on the widget status bar, then disappeared automatically when no action is performed. Below a dummy screencast to demonstrate : It is now really not polished (no comment in the code, no check to prevent exceptions, ...) but I posted it in this alpha state to get feedback about if some others also find it useful, and what features can be added to improve it.
EDIT : 2019/11/29 : Tree view is handled + right click can be used instead of middle click / Picture above not updated
EDIT : 2019/11/29 : Add imports of FreeCAD & FreeCADGui to be sure they are loaded
EDIT : 2019/11/30 : File extension is now '.py' and internal 'run()' function is available to programmatically run it
EDIT : 2019/12/01 : Add auto startup version as ZIP file. To be unzipped in the user 'Mod' folder (keep the including subfolder)
EDIT : 2019/12/04 : Add new tool that allow to change font size in dock widgets
EDIT : 2019/12/05 : Add helper to get full FC info as middle click on the 'C' Combo View toggler
EDIT : 2019/12/08 : Add the visibility 'V' tool / Description here to be updated (in between, please look at same date post in this thread)
EDIT : 2019/12/11 : Fix a PySide compatibility issue with FC 0.18 version
EDIT : 2019/12/13 : Update above description picture
EDIT : 2019/12/29 : Some fixes + increasing classes flexibility + adding new widget type to toggle boolean parameter
EDIT : 2020/01/01 : Bugfix (x2)
Last edited by openBrain on Wed Jan 01, 2020 5:42 pm, edited 13 times in total.
Re: [Macro] Bit of help for super users :)
This is great. Will test when I'm back in front of my machine.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: [Macro] Bit of help for super users :)
tree view, please. That's the only one I need, I think.
Re: [Macro] Bit of help for super users :)
Will update as soon as I have a computer available.
In between, I have no doubt that you're skill enough to add it by yourself. By the end of the macro, there is a list that defines the buttons in a (quite) simple way. Just copying how the eg. Property view is handled and adapting it to Tree view should be a matter of seconds. After updating, just run again the macro and it will refresh itself.
Re: [Macro] Bit of help for super users :)
Macro attached to OP update :
* Tree view is handled
* Right click can be used instead of middle click (this is OK as long as right click has non function)
Thx for feedback.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: [Macro] Bit of help for super users :)
Added it to my module of hacks, changed if __name__ == "__main__" thing to be a def run:. Error:
I know how to fix, just informing
Code: Select all
Traceback (most recent call last):
File "<string>", line 120, in InitApplications
File "<string>", line 5, in <module>
File "C:\Users\EMB\AppData\Roaming\FreeCAD\Mod\DeepConsole\FC_SU.py", line 64, in run
[custDockToggler, ['Report view','R', Gui.getMainWindow().findChild(QtGui.QTextEdit, 'Report view').clear]],
NameError: name 'Gui' is not defined
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: [Macro] Bit of help for super users :)
strange, but if I run it from InitGui.py, the only button I get is "D". If run manually, I get more buttons.
Re: [Macro] Bit of help for super users :)
Good to have testers that try advanced things. Will add the imports and update (in few minutes).
For the usage you described, would that help if I set the main instructions in a def run() and change to :
Code: Select all
if __name__ == "__main__":
run()