In the following of my question to that matter here :https://forum.freecadweb.org/viewtopic.php?f=3&t=43326
The idea is when you have multiple files open in different tabs and you work on different WB with each file (for instance Part and FEM and Assembly), that when you click from tab to tab, FC remembers what WB you were using with that tab and displays it automatically.
OpenBrain produced a Macro that seems to work :
openBrain wrote: ↑Thu Feb 13, 2020 3:13 pm
Attached a macro that tries to solve the problem.
Features are :
Notice that this is stored in the UI so not saved to file. However the good thing is that you can have 2 different workbenches for 2 different views of the same document (eg. PartDesign in the 3D view and Spreadsheet in a spreadsheet view of the same model). I think this is a correct approach but I may fail.
- Stores for each MDI window what is the active workbench (and of course recall it when the window has been left then reentered)
- Stores the current workbench as own one for all opened windows when launching the macro (of course can be changed afterward)
- Stores the current workbench as own one for newly created window (of course can be changed afterward)
If this is of interest, next steps could be (not exclusive) :
- Make the macro available through addon manager
- Provide the macro as a package so that it can be run at automatically at startup / Make this package available through the addon manager
- Hardcode this behavior in FreeCAD "core" and add an option to enable it
So I think it could be integrated as an option in Preferences, a box to check "Make Workbenches Tab dependent".
What do you think ?