Dynamo Rookie issue - List.IndexOf

Hello!
I have a excel spreadsheet with family type parameter information that i wish to override in Revit.
I intend to use type id as identifier between platforms.
Column one in excel contains the element ids, the “header row” contains the parameter names that i wish to override.

Dynamo is far from complete, but List.IndexOf is not currently working for me, and i cant figure out why.
See area marked with green.

excel example
Help 2

Dynamo

I hope that someone here would be able to point out what i am doing wrong and maybe even bring inputs on how to improve my mess.

Thanks!

You set the ReadAsString input on the Excel Nodel to False, so it reads a number as a number. But in the bottom part you convert the number of the Id to a String.

So by the time you are reaching IndexOf you are asking for the string “1234” in a list containing the number 1234. So you get no answers.

Use the Object.Type Node to determine with what kind of data you are working in different stages of building a script if you run into these kind of issues.

Also, learn about dictionaries, they are a way easier method to solving this kind of stuff than sorting through lists and finding the same Ids. I would get my QA under control and just do this with multiple TypeName - Value dictionaries.

3 Likes

Also: GUID (which is read only from the instant the item is created) is more stable over time than ID (which can change over the course of a project).

2 Likes