Passing nodes as functions in Python script

function
python
#1

Hi All

Do anyone know if it’s possible to pass nodes as functions in custom Python nodes?
and if so how is this done?

i’ve found this old discussion, maybe it’s been made possible again:
http://dynamobim.org/forums/topic/get-a-function-into-python-script-as-an-input/

1 Like

#2

This should be the up-to-date info:

0 Likes

#3

No, that was possible for a brief time in earlier versions. I don’t think it can be done now.

0 Likes

#4

@Sylvester_Knudsen1

You could declare your own class and call one of its properties or methods in another Python node:

MyClass code:

class MyClass:
    #A simple example class
    i = 12345

    def f(self):
        return 'hello world'
        
OUT = MyClass

MyClass.i code

OUT = IN[0].i

5 Likes

Python Nodes Basics