I am trying to add information from excel to revit using dynamo. However, I got stuck and could not figure out the way out.
Case: I am trying to look if object parameter “CCSSingleLevelID” matches data in column C, if it does the value from column A in the same row should be returned to the parameter “Duration”. The CCSSingleLevelID values are unique, there are no repetitves in both model and excel sheet.
Hey mate, I think you have runned into a similar issue I had short time ago, you want to compare two lists and find out the matching ones and assing a value according to it.
here is the post were my issue was solved, hope it can help:
(I will try to test it with your data, no promises I will achieve something, hopefully some veteran will do it shortly)
There is no comparison there - you are just reassigning the data in list a at index i to be the value j.
I assume you’re trying to compare List K (your parameter values from the Revit model), to the values in List I (the excel data with data that starts with a [L]), and return the value of lost J (the excel data with no prefix) when they match.
Start by using an == node to do the test for List K and List I. Watch lacing as you will need to get a single true/false value for each element in the Revit parameter value list for every item in the excel data list.
Then using an index of node to find the index of the true value for each sublist.
Next use a Get item at index node to return the value of each sublist.
Lastly use the Element.SetParameterValueByName node to assign the values.
Beat to rest this detached as your data set looks pretty large.
This post has helped me immensely so thank you to all contributors in advance. One additional question, Is it possible to expand on this idea and have multiple values from excel report back to different element fields in Revit? If so, what would that look like? See my markup of a previously posted image for further clarification.