Get input data on UI Node

Hi,

I am creating a UI Node (inheriting from NodeModel) and I need to use the data from the inPortData (a string) before creating the associativeNode output.

how get the data from the inPortData?

it appears to return the type portData but I cannot see anyway to get the data from the portData class.

a few questions:

why do you need to do this? Is it to construct the UI? Can you do it in the Build Output Ast with some other c# function?

If you can’t then look at how the color range node works, in the NodeViewCustomization for that node you can access getMirror which lets you access the data cached in a node.

have you seen this document? https://github.com/DynamoDS/Dynamo/wiki/How-To-Create-Your-Own-Nodes

it might be helpful

thanks for the suggestion.

I need to create an object with one of the node inputs as an argument and then use this object as an argument for the delegate function in the astFactory.BuildAssignment(). This is a ‘heavy’ object that I do not want to instantiate every time the node is updated as this happens several times per second.

It looks like the colorRange node has something similar to what I need to do - I’ll give the .GetMirror method a try