Is it possible to enable IntelliSense of functions, for a custom python module, inside Dynamo’s Python node editor?
I can import this custom module, without issues. Here is how module file SomeModule.py looks like:
import math
class SomeClass:
@staticmethod
def Addition(n1,n2):
return n1+n2
@staticmethod
def Subtract(n1,n2):
return n1-n2
like so:
path = r'C:\dynamo\SomeModule' # SomeModule.py file is inside this folder
sys.path.append(path)
from SomeModule import SomeClass
OUT = SomeClass.Addition(2,3)
The upper code works with or without empty 'init.py file in the folder ‘C:\dynamo\SomeModule’.
However, IntelliSense of functions ‘Addition’ or ‘Subtract’ does not work.
I even tried referencing a custom C# library, instead of python module. Here is the source code:
using System;
namespace SomeNamespace
{
public class SomeModule
{
public static int Addition(int n1, int n2)
{
int n3;
n3 = n1 + n2;
return n3;
}
public static int Subtract(int n1, int n2)
{
int n3;
n3 = n1 - n2;
return n3;
}
}
}
When source code compiled, it can be referenced in Python node without issues as:
import clr
clr.AddReferenceToFileAndPath(r'C:\dynamo\SomeModule\SomeLibrary.dll')
from SomeNamespace import SomeModule
OUT = SomeModule.Addition(2,3)
But again, autocomplete does not work.
Which is strange, because when ‘ProtoGeometry.dll’ library is referenced, IntelliSense works:
Does anyone know how to enable IntelliSense for a custom python module, or C# dll library?
I am aware of Talarico’s stubs for different editors (Atom, PyCharm, VSC…), but I would like to use Dynamo’s native Python editor, not an external one.
I would be grateful for any kind of help
Here are both the .py and .dll files.