Macros can be distributed inside Mod. The Addon manager install macros found inside Mods.suzanne.soy wrote: ↑Wed Jan 20, 2021 9:21 pm That's what I've been doing so far, but it prevents distribution using Tools → Addon manager → Macros (or Tools → Addon manager → Workbenches).
[Solved] Opening a file containing a FeaturePython from macro: how to ensure the class is imported properly?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Opening a file containing a FeaturePython from macro: how to ensure the class is imported properly?
-
- Posts: 54
- Joined: Sat Dec 19, 2020 11:55 pm
Re: Opening a file containing a FeaturePython from macro: how to ensure the class is imported properly?
That's great to know, I'll try experimenting a bit and post a template here / on the wiki. Marking as solved
Re: Opening a file containing a FeaturePython from macro: how to ensure the class is imported properly?
Why do you insist on renaming the file to init_gui.py ?
I thought the presence of an empty file called __ init __.py
was enough for any anything.py file to be imported as a module.
Anyway it seems to work for me.
Re: Opening a file containing a FeaturePython from macro: how to ensure the class is imported properly?
Yes you are right. I usually keep __init__.py empty and put code in init_gui.py because many of my extensions requires gui. But this is not mandatory at all, it was a suggestion. In programing there is always more than one way to achieve something.