Macro recipes: switching code to FreeCAD-macros?

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by microelly2 »

I have finshed the first version of the macro manager widget
the first problems should be solved - run trough a directory tree, extract the meta data from the files and getting a widget wit the entries linked to configurable methods.
its part of the plugin manager but should work alone too

next steps?
my intention is to follow the blender way (its not a creative action but I think many know blender and work with freecad and blender in parallel
so they are familar with this configuration process)
here the blender dialog
bn_681.png
bn_681.png (71.46 KiB) Viewed 7799 times
at the location entry there will be a dialog to place the macro into toolbars, menues and pie menues

and this is mine
bn_682.png
bn_682.png (121.68 KiB) Viewed 7799 times
I have added the meta information to some files

Code: Select all


__Comment__ = 'Imports and scales an Airfoil in the form of a Draft Wire (DWire) or Basic Spline (BSpline)'
__Web__ = "http://forum.freecadweb.org/viewtopic.php?f=22&t=5554"
__Wiki__ = "http://www.freecadweb.org/wiki/index.php?title=Macro_Airfoil_Import_%26_Scale"
__Icon__  = "/usr/lib/freecad/Mod/plugins/icons/airfoil.png"
__Help__ = "start the macro and follow the instructions"
__Author__ = "quick61"
__Version__ = '2.1'
__Status__ = 'stable'
__Requires__ = 'freecad 0.14.3706'
__Communication__ = 'your email adress or yourgit or something else'

User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by yorik »

Perfect!
I would maybe remove the word "freecad" from "Requires", and be careful with the icon absolute path (will not work on windows)
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: Macro recipes: switching code to FreeCAD-macros?

Post by galou_breizh »

@yorik: thank for adding me as collaborator...

... However, I just tried to write into the repository to test but didn't succeed, nor can I merge a PR. Can someone please have a look?

I can't promise that I'll be very active right now. Somehow the nice weather and the end of school year doesn't let much time in front of the computer.

Cheers,
Gaël
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by microelly2 »

I dont know why you cannot push to the master,
but until this is fixed we can go the way of yesterday - I can merge your requests.

please add the meta data to new added macros as in my example. so I will have more testdata for the macro manager. :D
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by yorik »

Yes that is always a good workaround, you can always clone the repository, work on your own version, then create a pull request directly on github.

Usually there can be two reasons why you can't write to a github repo:

1) some problem with authentication (ssh problem, wrong password, wrong protocol etc). Check with "git remote -v" that your repo is using git or ssh protocol, not https (which is read only on github)

2) your push is rejected because it is not a direct descendent of the version that is currently online. In other words, someone else committed while you were working. The solution is to git pull again before committing (it will create a "dummy" commit but that's no problem)
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: Macro recipes: switching code to FreeCAD-macros?

Post by galou_breizh »

I changed the repository to "git://github.com/FreeCAD/FreeCAD-macros.git" but then received an error message from git:

Code: Select all

fatal: remote error: 
  You can't push to git://github.com/FreeCAD/FreeCAD-macros.git
  Use https://github.com/FreeCAD/FreeCAD-macros.git
Actually, I don't think this is the problem because I can push to "https://github.com/galou/FreeCAD-macros.git".

Which address should I use with ssh? Do I need to generate a key pair?
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by yorik »

Aah, I just had a look at github, it says you didn't accept the invitation... Check at https://github.com/FreeCAD there should be a message.
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: Macro recipes: switching code to FreeCAD-macros?

Post by galou_breizh »

@yorik: thanks a lot! I just accepted the invitation and tried it successfully.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by microelly2 »

The last days before my summer break I start to migrate the macros from http://www.freecadweb.org/wiki/index.ph ... os_recipes
to https://github.com/FreeCAD/FreeCAD-macros

Pass 1
check in a version that is runable

Pass 2
add meta data to the macro

Pass 3
Check that the macros runs as expected with the current version of freecad

Pass 4
Make some Improvements to get a robust GUI and Error handling to avoid frustrated users

Pass 5
Update documentation

Whenever macros became obsolent because they are already in freecad master/ other workbenches integrated please give me a hint to save (my) time.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Macro recipes: switching code to FreeCAD-macros?

Post by microelly2 »

Added from the Wizard group:

apothemBasedPrism by Mark Stephen
GenevaWheelGui by Isaak Ayala and Mark Stephen
unrollRuledSurface by Herve Bailly
unfoldBox by Herve Bailly


Automatic Drawing is obsolent -- okay :?:
Post Reply