how to make paramectric-object macros installable by addon installer?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

how to make paramectric-object macros installable by addon installer?

Post by DeepSOIC »

Hi!
How does one craft wiki page in such a manner, that the macro is saved with .py extension rather than .FCMacro?

This is required for macros containing a parametric object to work, such as Macro Overlap for example.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: how to make paramectric-object macros installable by addon installer?

Post by yorik »

It is not possible ATM I think, but a solution could be to host it at https://github.com/FreeCAD/FreeCAD-macros
and modify https://github.com/FreeCAD/FreeCAD/blob ... er.py#L723 to also support .py extension

IIRC there is a trick on the macros pages too to signify that the code is hosted on github... @Mario52 do you remember?
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: how to make paramectric-object macros installable by addon installer?

Post by mario52 »

hi

Adding macro code outside of the wiki

Code: Select all

{{Codeextralink|link OBLIGATORY RAW page of the macro}}
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
galou_breizh
Posts: 436
Joined: Wed Sep 15, 2010 9:38 am

Re: how to make paramectric-object macros installable by addon installer?

Post by galou_breizh »

Isn't it possible to have a FCMacro file importing a module defining the parametric object? Metadata that lists the files that need to be installed alongside the macro can be added in macro files.

Gaël
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: how to make paramectric-object macros installable by addon installer?

Post by mario52 »

hi
yorik wrote: Mon Mar 11, 2019 8:12 pm ping

my last idea :

create a .zip file and copy the link on section Description or modify the Codeextralink| template for accept 2 links (txt and zip)

Code: Select all

{{Codeextralink|Raw macro address |zip file address }}
or the possibility download the macro with all dependence in a unique .zip file as external workbench



see example:

this work well , open Addon manager and see FCCamera, the link is visible in the description , click the link for download manually the icon package

ExtraMacro00.png
ExtraMacro00.png (12.77 KiB) Viewed 650 times

the modified page of the forum add the zip file (the wiki page do no accept the zip file):
create an angled pocket

the wiki page (add the link in the macro box Description section):
Macro_FCCamera

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
galou_breizh
Posts: 436
Joined: Wed Sep 15, 2010 9:38 am

Re: how to make paramectric-object macros installable by addon installer?

Post by galou_breizh »

Adding a FCMacro file importing a *.py file seems to work. At least it works on my system. Cf. https://github.com/FreeCAD/FreeCAD-macr ... me.FCMacro.

Gaël

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16065 (Git)
Build type: Release
Branch: master
Hash: 8f58abfd4961c645b3b4d7ffeea65fd551b7159b
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Post Reply