Compose Functions

Hello,
With a script i would like to create an action which will set 3 global parameters and than save the .rvt-file.

These actions I would like to loop with a List.Map node and the Function Compose node, so I can do these for multiple lists…

Now the problem is that I don’t know how to set the script so, that it will use only the
0-indexes for the first parameter,
1-indexes for the second parameter,
2-indexes for the third parameter,
and the 3-indexes for the last parameter

What am I doing wrong?

function composition is not a good fit for this -
use a custom node or get item at Index - unless of course you really want to learn about function composition - then you’ll need to keep in mind that when composing a function the return value of the first function is fed to the next function… and you’ll need to create pass throughs to return the correct values for this to work… I think it will be tricky.

Hello @Michael_Kirschner2 @thurevit3

I tried a different approach, although it has not been very affective.

Within the custom node ‘DakLoopV2’ I hold the 3x GlobalParameter.SetValue’s and the Document.SaveAs nodes. Therefor it should apply the ‘DakLoopV2’ to every value of the list individually. It only gives me an ‘Empty Dictionary’ though.

hmm, what version of Dynamo is this?

I don’t think you can use numbers as keys, try converting the x to a string before using it as the dictionary key.

Hello,

I’m using:
Revit 2020
Dynamo Core 2.2.1.5175
Dynamo Revit 2.2.1.5291

It’s definitely not a logic way, but i thought it would be easier to loop on a list in stead of lists within list :smiley:

For anyone searching for the same kind of method, here is a solution:

This DesignScript is able to loop while using Dynamo-Nodes within that loop!


image

#loop #designscript #revit #looping #forloop

2 Likes