Node development: get set a list of curves?

Hi experts,

I am new to dynamo node development and I hope you can help me :slight_smile:

My goal is to create a node using visual studio that will take a list of curves and then export this to another application using its API. I have succesfully gotten the really cool DynamoUnchained example working which has helped a lot.

However, what I cannot figure out is how exactly to retrieve a list of objects (in my case a list of curves) from the input node. I assume it has to do with the inputAstNodes[0] but I am unsure.

In Rhino/grasshopper, I would do something like this:
List<Rhino.Geometry.Curve> CurveList = new List<Rhino.Geometry.Curve>();
if (!DA.GetDataList(1, CurveList )) { return; }

But this does not seem to be the way Dynamo works.

Hopefully someone can help me. Having no formal training as a programmer I also hope my question is clear, otherwise I will of course elaborate.

Thanks!!

Edit 1: I forgot to mention my project is in C# as the external API’s language is also C#

why implement your node as a nodeModel node? (thats a node where you need to use the AST) why not just use zero touch node?
read here:

and here:

http://dynamoprimer.com/en/10_Packages/10-5_Zero-Touch.html

also this one has zero touch samples.

Dynamo’s node model (NM) nodes use an MVVM pattern and are only necessary if you want to customize the appearance of the final node (add buttons, dropdowns, custom WPF controls, etc.). They should ideally contain only the logic that prepares, controls and tracks the appearance of your node. The main logic should be contained in a separate assembly loaded as ZeroTouch (ZT) nodes. The NM node would then “subscribe” to a function in that ZT assembly and whenever it’s executed, would pass the input to it.

Have another look at the samples and check out the “AstFactory.BuildFunctionCall” method call.

It sounds like a lot of work but it’s necessary if you want to have a responsive UI and avoid degrading the user’s experience.

The only time you’d want to process the input directly in the NM node is when the node’s UI changes based on the input and unfortunately this part is a lot less straight forward. One example on how to do that is archi-lab’s builtin parameter selector and its customization

Thanks for the comments! It seems then i have been looking in the wrong direction, as my assumption was that creating a WPF project was a step up from the zero touch nodes. And for example that it would allow me to have additional debugging comforts while scripting. I also thought zero touch nodes would probably not allow references to other libraries, but as I understand now, this is not the case?

I am thinking however about creating my nodes in such a way that they would feature a button to pass my data. With Dimitar’s solution I understand this is still possible with zero touch nodes. Do you perhaps have a reference that I can look at?

Thanks again!