How to call Custom Nodes from Code Block node?

Hi All,

In case you all are wondering how to call custom node from a code block in Dynamo, here is the solution.

When you drop a custom node in Dynamo canvas and if any of the input is missing then it’s output is a Function object. A function object can be executed using the method DoEvaluation as shown below.

What if you want to pass multiple input to your custom node from the code block, then you need to chain the call of node.DoEvaluation(x).DoEvaluation(y) as follows:

You can also call your custom node inside the imperative block.


Please note that DoEvaluation method on function object is an internal method and may change in future.

6 Likes

Is there any way yet to include a function object in the code itself, without having to connect it to an input port in a code block?

My documentation on designscript is a very odd collection of bookmarks from twitter, dynamo forum, blogs, old designscript manual and what not… Hopefully the documentation can be more unified documented in the future! Great tip, though! :wink:

Is there any way yet to include a function object in the code itself,
without having to connect it to an input port in a code block?

Not yet. However, there’s a much more elegant way to feed in multiple inputs for a function node:

3 Likes

In case you want to use replication guide __ApplyList may not work.

Give it a try :slight_smile:

3 Likes