Read multiple values from Excel file

Dear All,
For a recent project, I created a dynamo script to automatize pipe insulation according to system name and pipe size. It’s working well and I’m happy with that.

What i would like to do is to update my workflow to an upper level of knowledges I don’t have yet.
My idea is to read multiple value from excel file.
I already managed to read one value from excel fil but multiple… it an other thing!

Let me explain it to you:

I have this excel file:

I want my script, for each pipe/pipe fitting in my project to collect 2 informations:

  • System abbreviation (let’s call it value “MA”)
  • Pipe/pipe fitting size (let’s call it value “MB”)

This is the easy part.

Next step: I want to search for MA then MB value and collect Type/Material and then the thikness value.

Once i have those values, it will be easy for me to set it into the elements throught the Set.Parmater.value.by.name node (already done many time).

Doe’s anyone have a tutorioal or node to point me to explore that?
In fact I’m stuck in the construction workflow as I don’t know how to compare 2 list: one with only 2 values (MA and MB) and the other one with 18 values (columns)

I tryed transposing list from my excel file but I’m not sure I’m on the right way…

Thanks by advance

Look into List Levels on the primer. The logic for one item is the same as the logic for many items; the only difference being how lists are handled.

Hi,
some (little) advance in the past days…

I managed to read my excel file and to create one list for each system abbreviation i have.
I managed to extract all system abbreviation from my current revit file.

I’m now stucked to, according to the pipe’s system abreviation to go pick up the value inside the right sublist (reading from excel file).

Any node recommendation to do it?

Thnaks by advance

Sounds like a good use of a dictionnary

You may use node List.IndexOf to find out which index of excel list is matching with every pipe’s system abbreviation.
And then you will be able to get excel data from other columns by using this list of indexes.

Me again,

Thanks @Daniel_Hurtubise for the advice. I discover a new usefull node!

So, I managed to read my excel file and create dictionary by System abbreviation (and then all the values attached to them) _See bottom part of my script

On the other hand I managed to collect all elements in my model, returning their dimension and create a dictionnary by System abbrevation (keys) and values

Maybe I took the wrong way but I was thinking that it could be a way to compare two dictionary.

For exemple:

  • On dictionary “CHWR” from Excel file I will read the value of index 3 which correspond to insulation thikness for DN32

  • On dictionnary “CHWR” from model I will collect elements with size value DN32

Once I collected those elements it will be easy to add Insulation and insulation thikness.

I just don’t know how to compare values between dictionary.

Any advice is welcome!

Thanks