I’ve come across this problem a few times now . . .
I want to apply more than one thing to a list, but LoopWhile and List.Map only allow one function as input.
My current problem is I am swapping parameter values, so there are two simultaneous functions at the end to write the parameter values. When I make this into a node there are 2 outputs.
I’ve tried Function.Compose, combining them outputs into a list, nothing works.
The graph works fine on a single element, but I can’t work out how to apply it to multiple elements.
Why not just put the two SetParameter nodes in sequence?
I think that the problem arises from the fact that when you have more than one element, you need to apply lacing to the nodes. Another approach might be to use replication guides instead of lacing. Check out the example below:
Andreas solution worked, once again.
Although the wider question hasn’t been answered. We often write code to do multiple things to multiple objects. Being limited to a linear sequence with one outcome seems very restricting.
And a warning to others, if you edit a schedule while Dynamo is running it doesn’t always see the changes in the schedule. You have to exit and start Dynamo again.
Here is another example.
Custom node ‘FixUSdate’ takes a string in date format and swaps the first 2 duets of numbers - 01/02/2015 becomes 02/01/2015.
I want to apply this to all values of a parameter (in this case ‘Sheet Issue Date’).
So I use List.Map to go through all Sheet elements.
But I need to do 2 things, read the existing value from the parameter, then write the new value to the same parameter.
So both GetParameterValueByNameAsString and SetParameterValue need the current element id.
Obviously the order the functions operate is important but their doesn’t seem to be a way to control this.
There seems to be a fundamental gap in Dynamo - operating multiple functions on a list is not possible.
Virkam, I don’t think you understand the problem. FixUSdate works fine.
But I’m not surprised you didn’t understand because the reason it doesn’t work is so dumb.
I’m using a node called ALL Elements of Category. Duh, you don’t need to use List.Map to go through all elements.
But seriously, I didn’t expect the other functions to step through each member of the list automatically. Which is a pretty neat feature.
Antony, the problem actually has less to do with the nodes you are using (though that matters too) and more to do with the sequence/flow of the connections.
Ignore FixUSdate, it’s just a little script that does the needful (in this case) without custom nodes and is relatively irrelevant to this discussion.
Vikram, appreciate your input. You Designscript works a treat and avoids the need for a whole lot of nodes.