Hi All,
Just wondering if there is a quick way to connect multiple nodes to an export node without typing them all in or wiring them up.
I have say 20 polygon nodes I would like to link up and after a bit of experimenting didn't really get anywhere.
I tried a function to pull the names of the nodes into a nice list but I had turned them into a string and the export node is expecting a geometry node.
This is my function:
function (string NodeName, int count){ string NodeList = {}; string NodeItem =''; for (int i = 1; i < count +1; ++i) { NodeItem = ToString(NodeName + i); NodeList.Add(NodeItem); } return NodeList;}
but as you can see I used the string type to get the list from a NodeName and count I input in the function node.
Anyway to extract this back to the type needed for the export node?
Thanks
Wayne
Hi Wayne,
You got very close and recognized the obstacle: you are collecting the names of the nodes, but not the nodes themselves.
If you know the name of the node you want to collect then you can use the function FindNode(string nodeName) to find the node object.
Those node objects you would collect into an object list.
Your function then looks like this:
function (string NodeName, int count) { object NodeList = {}; string NodeItem =''; for (int i = 1; i < count +1; ++i) { NodeItem = ToString(NodeName + i); NodeList.Add(FindNode(NodeItem)); } return NodeList; }
HTH,
Volker
Answer Verified By: Wayne Dickerson
Thanks Volker,
I was so close. :)
Great way to create a list for export nodes.
Makes me think of other ways it could be used when you need a list of nodes.