Autoload

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Autoload

Postby triplus » Fri Jun 16, 2017 4:07 pm

Autoload.png
Autoload.png (50.48 KiB) Viewed 1894 times
Autoload module for FreeCAD.

Provides ability to load more workbenches on FreeCAD start. Such ability can be useful for workbench customization purposes and in combination with modules such as PieMenu, ShortCuts, CommandPanel ...

Code repository:

https://github.com/triplus/Autoload
User avatar
microelly2
Posts: 4363
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Autoload

Postby microelly2 » Fri Jun 16, 2017 4:28 pm

Good idea

can this startup loader be extended to do some more startup configuration?
I had the problem to add some pathes to my python environment
https://forum.freecadweb.org/viewtopic.php?f=22&t=21996
and it seems a good place to connect to these 3rd party modules too.
User avatar
sgrogan
Posts: 5334
Joined: Wed Oct 22, 2014 5:02 pm

Re: Autoload

Postby sgrogan » Fri Jun 16, 2017 7:21 pm

This is indeed very interesting. One of my favourite FreeCAD features is the "lazy loading" But I have a startup macro that's cycles through a few workbenches so some commands/icons are immediately available at startup for global custom toolbars. Allowing the user to tune this behaviour seems convenient. I will definitely test this.
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Autoload

Postby triplus » Fri Jun 16, 2017 9:50 pm

I can investigate and try to add something like that. In a simple form.

P.S. Will first do some test and prototypes and lets see what will be the result.
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Autoload

Postby triplus » Fri Jun 30, 2017 2:07 pm

Features added:
  • Autoload modules from macro folder
  • Import can occur on two FreeCAD start stages
  • Exception handling
Use case:

New.png
New.png (37.96 KiB) Viewed 1689 times

Use the following convention:
  • Prefix: Autoload_ (or Autoload_1_ to import module at latter FreeCAD start stage)
  • Name: Any (ASCII)
  • Suffix: .py
Enable.png
Enable.png (55.77 KiB) Viewed 1689 times

Restart FreeCAD.
chrisb
Posts: 18165
Joined: Tue Mar 17, 2015 9:14 am

Re: Autoload

Postby chrisb » Fri Jun 30, 2017 4:28 pm

In Path Workbench was recently introduced a special folder for the post processors. Perhaps the same technique could be used here. Advantages: keep the macro directory tidyer, no need to rename.
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Autoload

Postby triplus » Fri Jun 30, 2017 7:34 pm

chrisb wrote:
Fri Jun 30, 2017 4:28 pm
In Path Workbench was recently introduced a special folder for the post processors. Perhaps the same technique could be used here. Advantages: keep the macro directory tidyer, no need to rename.
No as this feature was added for regular users. And they shouldn't need to care about things like that. And i tried to make sure the whole procedure can be done from the GUI with only a few clicks. If you are developer you have all other options available at your disposal. ;)

P.S. Need to rename what?
User avatar
Kunda1
Posts: 5529
Joined: Thu Jan 05, 2017 9:03 pm

Re: Autoload

Postby Kunda1 » Fri Jun 30, 2017 8:04 pm

@triplus I submit a PR to tweek the README.md
https://github.com/triplus/Autoload/pull/2
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Autoload

Postby triplus » Fri Jun 30, 2017 8:22 pm

Kunda1 wrote:
Fri Jun 30, 2017 8:04 pm
@triplus I submit a PR to tweek the README.md
https://github.com/triplus/Autoload/pull/2
I'll take a look tomorrow.

P.S. By taking a quick look image and a bit of fine tuning the description makes sense. As for the rest i am not sure for now. I would likely rather see a link to FreeCAD wiki to be added (describing the procedure in detail). Instead of providing such verbose (install) information for each module.
User avatar
Kunda1
Posts: 5529
Joined: Thu Jan 05, 2017 9:03 pm

Re: Autoload

Postby Kunda1 » Fri Jun 30, 2017 9:16 pm

triplus wrote:
Fri Jun 30, 2017 8:22 pm
Kunda1 wrote:
Fri Jun 30, 2017 8:04 pm
@triplus I submit a PR to tweek the README.md
https://github.com/triplus/Autoload/pull/2
I'll take a look tomorrow.

P.S. By taking a quick look image and a bit of fine tuning the description makes sense. As for the rest i am not sure for now. I would likely rather see a link to FreeCAD wiki to be added (describing the procedure in detail). Instead of providing such verbose (install) information for each module.
Good point. It goes without saying that the motive behind it has several reasons
Uniformity between all FC addons,
Options for folks who'd rather not use the addon manager who have or don't have git.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features