Plugin Loader

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
sgrogan
Posts: 6206
Joined: Wed Oct 22, 2014 5:02 pm

Re: Plugin Loader

Postby sgrogan » Tue Oct 27, 2015 8:25 pm

godblessfq wrote:How do I make a custom toolbar for all workbenches without define the same content repetively?
Tools>Customize> then choose the toolbars tab, then in the workbench selector on the right choose Global. Then create your toolbar and it will show up in all workbenches.
"fight the good fight"
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Tue Oct 27, 2015 8:26 pm

godblessfq wrote:How do I make a custom toolbar for all workbenches without define the same content repetively?
See my example file
https://github.com/microelly2/freecad-p ... onfig.yaml

you can reuse entrys in yaml by the anchor pointer construct

Define an anchor &ABC

myEntry: &ABC
yourData: ...


Reuse it with *ABC

myEntryElseWhere: *ABC

In the example Files the *FEM, *pcb point to entries in the pluginloaderconfig.yaml
https://github.com/microelly2/freecad-p ... onfig.yaml

maybe interesting for you
https://www.youtube.com/watch?v=VIc4yU2vrSA
https://www.youtube.com/watch?v=sDgoF9ddBLg
https://www.youtube.com/watch?v=88bKd3NRtfQ
godblessfq
Posts: 94
Joined: Fri Jul 17, 2015 7:40 pm

Re: Plugin Loader

Postby godblessfq » Tue Oct 27, 2015 8:28 pm

I would make another feature request. The tabs in plugin loader (cad, cam etc.) maybe better be placed horizontally, since it scrolls with the list, the user lost the position in the tab while scroll the list and you need to reach the bottom to access previous tab and next tab arrows. Just my opinion.
Thank you for your great work! I wish someday I can be as good as you guys.
godblessfq
Posts: 94
Joined: Fri Jul 17, 2015 7:40 pm

Re: Plugin Loader

Postby godblessfq » Tue Oct 27, 2015 8:32 pm

sgrogan wrote: Tools>Customize> then choose the toolbars tab, then in the workbench selector on the right choose Global. Then create your toolbar and it will show up in all workbenches.
:) How could I didn't see it! I have played with the xml file for a whole night. Thank you!
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Tue Oct 27, 2015 8:33 pm

The best feeling is without scrolling, so the entry lists should be shorter for all tabs.
It's still a nice to have project too.
horizontal layout was in the first version - but another opportunity is to make it configurable (I will rethink it ;) )
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Plugin Loader

Postby cox » Mon Nov 09, 2015 7:49 am

Great work microelly2

With some guidance integrating FreeCAD in Arch, I have finally managed to properly install and run your plugin.

I have come across one issue in both Arch and Mint 17.2:
Installing Parts Library, both plugin and library installs fine. However when trying to activate the plugin I get problems.

When starting the Part Lib from Plugin Manager the plugin seams to start fine

Code: Select all

!fn="/usr/share/freecad/Mod/plugins/FreeCAD-library/PartsLibrary.FCMacro";exec open(fn).read()!
/usr/share/freecad/Mod/plugins/FreeCAD-library
But when browsing the Library with single click i get

Code: Select all

Traceback (most recent call last):
  File "<string>", line 118, in clicked
NameError: global name 'zipfile' is not defined
'import zipfile, tempfile' from python console. corrects this problem and subsequent browsing works perfectly.

If i try to start the Parts Lib module by running.

Code: Select all

fn="/usr/share/freecad/Mod/plugins/FreeCAD-library/PartsLibrary.FCMacro";exec open(fn).read()
directly in Python console the module works perfectly.

I also tried to past same code in Macro and that seams to work perfectly also.

I can not for the life of me figure out what is causing this, for a log time I have been under the impression that this problem was caused by the non FreeCAD folder structure in a Arch installation, but as I get the same results in Mint it points to some other issue.

Can anybody else confirm this problem or shed some light on what could be causing it?
Need help? Feel free to ask, but please read the guidelines first
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Mon Nov 09, 2015 2:22 pm

Hello cox,

It seems that during the execution from inside the pluginmanager the path to zipfile is lost

The location of the zipfile module you can get this way

>>> import zipfile
>>> zipfile
<module 'zipfile' from '/usr/lib/python2.7/zipfile.pyc'>
>>>

Next step can be to add this path before the exec call

exec( 'import sys;sys.append("path-to-zipfile-on-arch-linux");\n' + open(fn).read() )

can you please check whether this works for you. then I can implement an automatic soluten ..
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Plugin Loader

Postby cox » Mon Nov 09, 2015 3:41 pm

I get the same results as you when running
In Arch:

Code: Select all

>>> zipfile
<module 'zipfile' from '/usr/lib/python2.7/zipfile.pyc'>
In MInt:

Code: Select all

>>> zipfile
<module 'zipfile' from '/usr/lib/python2.7/zipfile.pyc'>
microelly2 wrote:Next step can be to add this path before the exec call

exec( 'import sys;sys.append("path-to-zipfile-on-arch-linux");\n' + open(fn).read() )
I do not quite understand where you want me to insert this line?
Need help? Feel free to ask, but please read the guidelines first
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Plugin Loader

Postby cox » Mon Nov 09, 2015 3:49 pm

microelly2 wrote: It seems that during the execution from inside the pluginmanager the path to zipfile is lost
Does this happen on your machine also, or is it just on my machines?

Just to be clear: The only thing that is affected is the preview function of the parts. Adding parts to documents is OK
Need help? Feel free to ask, but please read the guidelines first
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Plugin Loader

Postby microelly2 » Mon Nov 09, 2015 7:51 pm

cox wrote: Just to be clear: The only thing that is affected is the preview function of the parts. Adding parts to documents is OK
May be I misunderstood you, I will test it.