I am writing some custom nodes to make use of a software package that has COM interface. The first step in the process is to create the COM object and then load a file to create a “session” in the software. This session then needs to be passed between all other custom nodes. I have this working to some extent but when I try to have 1 custom node to load the session and pass the resulting com object to another custom node, I get some strange behaviour. The custom nodes will be using python. My first custom node to load the session looks like this:
import clr import sys import System t = System.Type.GetTypeFromProgID("myComObject") o = System.Activator.CreateInstance(t) o.Open(IN); OUT=o
The file name to load is passed in to this.
I have a custom node that creates the com object, loads the session and returns the object:
If I then create a simple python code block and pass this com object to the python IN, i can make use of it and do everything I need and get meaningful results from the com object. Like this:
where the script is like this (well much more than this really but for purposes of demonstration)
o = IN; v=IN OUT=o.DoSomething(v);
I then want to create a custom node from the second script. I do this and need to create the 2 input variables.
So the first question is what type should I give to the com object input? I’ve tried var, System.Object, System.__ComObject (not recognised). With var this gives a strange result:
The watch window always just says “Function”
If I remove the first input complety from the custom node and then load the com object in the script, it works again. Something about passing the com object into the custom node causes the output to always be set to “Function”. Even if I have the most basic script:
But still have the com input, it still says “Function” in the watch. Hope you can help.