I am creating a bunch of add-ins for Revit using pyRevit, and it is simple to use. I am not that new to python so I have successfully imported many classes with its method in other projects so I could avoid repeated code, etc.
I am trying to do the same in pyRevit but no success.
What I would like to do is to create something in an upper folder and import its methods when needed.
something like:
|Main Folder
|- methoslibrary.py
|- option1.psuhbutton
|-- script.py
|-- icon.png
|- option2.psuhbutton
|-- script.py
|-- icon.png
|- option3.psuhbutton
|-- script.py
|-- icon.png
and access all the methods from methoslibrary.py from their children's script.py files.
I am trying to import the file with a:
from main.methoslibrary import *
from one of the script files but no success, even though this works for other python projects.
Any ideas? Should I change any config?