Combine lists based on a key value

Continuing the discussion from Combine data from two lists into one new list:

Hi all, I found what looks like the solution to this, but its on a very old thread and i cant access the files. I have a similar issue i cannot figure out.
I have a .csv file with all of my IFC enumerations (Column A), it then lists certain project specific information for each value on that row. I have a Revit model which has all of the IFC enumerations applied to it. I would like to import the excel file, and get the relevant info from that, then get the IFC info from the Revit model, and if the IFC enumeration matches the database > populate the other parameters within Revit (taken from the excel file). Its just the mapping/matching of the two datasets im struggling with. See attached definition where i am at (along with example revit file and excel database im using). Any help would be appreciated. Its Revit 2022

CombineData.dyn (35.1 KB)
IFC mapping (2).xlsx (10.3 KB)
Model example.rvt (4.3 MB)

See if this gets you going. I am using Excel vs CSV because some of your data has commas in it.

Also, the “Comments” parameter was missing from the model.

CombineData.dyn (30.8 KB)

3 Likes

Hi Sean,

Thanks for this, yes, id prefer the Excel inport also, but its not currently working for me as my Office 365 needs updated/reinstalled and our I.T are very slow at these things xD So have to stick with .csv for now. I replaced the commas with stops for testing as i hadnt noticed. However, i cant seem to get it to work as expected. It is only pushing one value into all the walls in a random order:

Any advice?

1 Like

Could you share what your graph looks like now with your changes. Please also have the dropdown previews shown so we know what its doing.

See attached script im using and the updated database (I had to convert back to .xlsx so i can upload it here) - Its just the same as your script but with the csv node instead of excel. Im likely done something incorrect so apologies xD
IFC mapping.xlsx (10.2 KB)
CombineData (1).dyn (25.3 KB)

I am not really sure why the data structure is not really the same in the CSV vs Excel nodes, but I think this should work.

CombineData (1).dyn (24.8 KB)

Thanks, but unfortunately its still not behaving. My “Dictionary.ValueAtKey” does seem to be different to yours (it matches when i set lacing to shortest?). When i run it it does not add the parameter values into the model correctly. I really appreciate the help on this.

1 Like

My last image was when I forced it to find a value because I was not using your model at the time. So, what you image show should be correct and looks like it is finding the value. What does the output on the SetParameter node look like?

See setParameter below:

And this is what the wall schedule looks lie just now:

What is the lacing set too on the SetParam node? I am wondering if it’s because the lost of params is flatter than the walls.

Hi Sean, so i got it to work (or so i thought) by setting the last node to cross-product lacing and adding a couple of filters into the script. See the updated version attached. Thank you very much for your help on this so far, much appreciated!
It works if the elements all have the same values, but if i have multiple types with different values per type in the database it will just put the same value into each type. Any insight to this?
Ive attached an updated database and model (The script can be run on Roofs and Walls categories)

CombineData.dyn (47.9 KB)
Model example.rvt (4.3 MB)
IFC mapping.xlsx (10.9 KB)