Designscript / Python to loop through multiple columns in Excel to apply multiple parameters to elements

I created a “regular” dyn file (thanks to MartinSpence for the help) to apply multiple parameters (SP1, SP2) to 3 elements according to their unique ID.

The issue is the amount of parameter will increase, the column size of the added parameters in Excel will be the same as that of SP1 and SP2.
With the “regular” dyn I have to manully add nodes to account for the added parameters.

I want to use loop either in Designscript / Python to loop through each “parameter column” to automatically account for the added parameters.

I know how to do loop in Designscript to create geometry, like this one ,
variable p is geometry collector to collect all points generated by the Loop.

But I have no idea:

  1. is it necessary to define such variable collector in my case? Since the outcome is “applying parameter to elements”.
  2. then what needs to be collected?

RVT (v2019), dyn and excel can be found here:

Dynamo will “loop” automatically with the right list structure. Search the forum for more posts about assigning multiple parameters. There are plenty of solutions out there. If you run into any specific issues let us know and we can help you troubleshoot them.

1 Like

@ Nick_Boyts

I know for each parameter. eg. SP1, DY will “loop” to apply the values of one parameter to the elements.
I’ve already did that in regular way.

This one applies the 1st parameter SP1 to elements.

This one applies the 2nd parameter SP2 to elements.

If there are more parameters added, eg. SP3 and SP4
I have to manully add similar nodes into dyn.

The index number in DY represent the index of parameter in Excel, the total number of parameters equals to columns in excel (5) - 1 = 4

The specific issue is I don’t know how to explictly use “loop” to loop through all parameters, in the above case from 1 to 4.

for (i in 1…4)
apply values of parameter (i) to elements

You don’t need to set up a new “line” for each parameter. As long as your input lists have the right structures Dynamo will loop through all of them correctly. There are a couple ways to do this and that’s why I suggest searching through the forums.

I figure that out, there is another “tiny” issue that I make a new discusion here.
Is list@L1 equal to flattened list?