SetParameterByName for multiple elements in a list

Dear fellow Dynamo developers

I feel like I am pretty close to getting the Dynamo script that we need. There is only one last node that does not seem to do what I expect it to do. I am not entirely sure if the problem is it being the wrong not, or that I might have gotten something mixed up that resulted in the incomplete output.

Another set of eyes and minds might be all I need here. Maybe there is something obvious that I failed to spot. Would appreciated greatly any opinions and ideas!

Goal:

  • to make a Dynamo script that would, collect Room elements in a model and take their parameter “Number”,
  • compare it to data in an Excel file, retrieve corresponding parameter data to that code “Number”
  • set all data to the corresponding Room element

1.) Below are the 3 test Room elements, with parameter “number” SB101, SB102 and SB103 starting from the largest room, counter clockwise


2.) This is the format of the excel file. There is a list of numbers, and we want to automatically fill up the room code, name and comment to each code, instead of manually inputting them per element. All 3 elements were identified in the ElementFilter.ByParameterStringValue and all their data were also retrieved by the code index from the excel.
02-Excel%20Data

3.) This is the Dynamo I ended up with. So far, all the outputs for all nodes except the last SetParameterByName are as expected. There is something not working about the last node, however, as it only seems to get the number code of the first room, apply the parameters from the excel, but does not continue to apply it to the other 2 elements with codes

4.) Only the large SB101 room is updated with the correct data after the script runs. The other two rooms were listed in the script, but the SetParameterByName did not feed data into these elements.

I think the parameter names and values don’t iterate in the way you wanted. i tried to recreate the graph but it’s a lot of work. Could you send the files as zip?

Kind regards,

Timo

Here they all are. Thank you

I couldn’t find the solution to your graph and didn’t have that filter node in my packages.
That’s why i changed it to behave like I would create this.

If this solves your problem please set as solution.

Excel Importing-V04.5.dyn (64.3 KB)

1 Like

thank you! yes it worked now… will still do more testing to check, but as is, this script does exactly what I wanted

The filter node was from the rhythm package

I noticed that you remade almost half of the code. Most of your nodes involve lists and manipulating them. Will be taking time to study it further and understanding the logic behind this code.

again, thank you!

The understanding of the way dynamo(irontpython) handles lists and iterates through them is very helpful. That’s why after the second I uploaded the graph I saw some improvements that are possible.

Since I started using python in my dynamo graphs my use of OOTB nodes went down exponentially.
I think my solution is a way to solve your problem but definitely isn’t the best(fastest) way.