A Node that creates nodes in the Node-view?

I understand how to and have created custom nodes that I can use in other projects. Most of my custom nodes create geometry in the geometry view, or wrap around my other geometry nodes. I’ve done some I/O with excel, and SVG.

Is it possible for my custom node to generate other nodes in my workspace, and then make connectors between them? For example, I want to specify a count (e./g. 3) of my custom node “node_with_InputA_OutputB” and attach Node1.OutputB to Node2.InputA and Node2.OutputB to Node3.InputA. The result would be that three such nodes appear in node view, with the appropriate connectors.

Thanks!
Bruce

yes - it’s possible.
in general my advice would be to write an extension or view extension instead though. It’s difficult to reason about the execution order of the graph in all states, and it’s even more difficult if you have a node that is modifying the graph.

Instead for application level interactions the extension API is simpler to reason about.

checkout the samples:

Extensions · GitBook (dynamobim.org)
DynamoSamples/SampleViewExtension.cs at master · DynamoDS/DynamoSamples (github.com)

you can use the createNodeCommand -
Dynamo/RecordableCommands.cs at 17f1104ef0b2c8b645f5bbc1a8cc5046b3de544f · DynamoDS/Dynamo (github.com)

here is an example of running this command to create a zerotouch c# node.
Dynamo/HelixImageComparisonTests.cs at 6fec05322c022f393f313db6d03150d78edfee59 · DynamoDS/Dynamo (github.com) - it might be a bit different from an extension - I think you’d use the commandExecutive interface to send the command to the dynamo instance.

Michael,

Thanks so much for your reply. I haven’t yet run into challenges related to execution order (that I’ve noticed) such that in fact I hadn’t even considered that topic until you mentioned it so it’s a good warning.

I like the UX connecting the node objects with wires, and the zoom/pan nav. If I can replicate that in another view with the same capabilities that will work. I have seen the Mandrill examples which seem to follow part of that pattern. I’m also wondering if I could place the connectable nodes together with the geometry in a 3d view, maintaining the ability to connect nodes. But I’m definitely getting ahead of myself - I was hoping for a built-in node to generates nodes :wink:

I started reading the links you sent, quickly landing on the Dynashape example, which I am excited to dig into. Just another example of amazing possibilities with this tool. I’m also thoroughly enjoying the fact that this excellent work is created by my colleagues!

But it sounds like I’m going to need Visual Studio to build my extension, and so I need to decide either to partner with a developer or get my own. I also want to access an API for data which sounds like I also need to develop, so I may have to just do it!
For now, I’ve got plenty of reading…
Thanks again,
Bruce

Visual Studio Community 2019 - Free IDE and Developer Tools visual studio community edition should work fine - and it’s free - though you’d have to read the license to see when a paid license is required.

I’m not aware of any packages that include “meta programming” nodes - but it would definitely be an interesting tool.