
Code: Select all
def Initialize(self):
import tools
Gui.addCommand('CreateGlider', tools.CreateGlider())
In my case it is working because I have the freecad_glider directory inside of /usr/lib/freecad/Mod which is in my case part of the sys.path.import freecad_glider cannot work inside the same directory, to get the path
Yes, I agree. As the number of workbenches increases there will come conflicts. My idea was to put the extra modules (macro collections into a subdirectory where I can manager the __init__.py). But for workbenches the users want to have in the workbench list. I think there should be a discussion continued to get a robust redesign that allows the integration of community workbenches with clear defined namespaces.looo wrote: As I have already said in another topic, I am not happy with the freecad way to add python modules. I think this has to be fixed. A solution would be to not add every package to the python path, instead only add the base directories (/usr/lib/freecad, /home/.../.FreeCAD/Mod). + changeing the shared objects to _package.so and import them in the __init__.py of the package.