Getting the wrong index from the excel file using Dynamo

I want to get the index numbers of the list which is imported from excel file associated with the selected Revit elements using Dynamo. The problem I have is when I use the List.IndexOf node and connected the selected elements & list, I get the index “-1” that it is not valid.
I attach the screen shot of dynamo code for more clarification. I can’t figure out what is my problem.


When I want to get the specific For example here, I want to get the index automatically based on my selected elements here would be index number [07,14,21,28]

Any Thoughts!

Thanks.

Hello …try all indicies… and get the name from your element and compare

1 Like

Hi @121madhu ,

You aren’t getting any results since you are trying to see if a list of ElementTypes contains the string “Wall”.
These are not the same objecttypes and as such aren’t matched. You’ll have to get the name of the ElementType first.

3 Likes

Object.Type node will help quite a bit here. :slight_smile:

1 Like

Thanks a lot. It worked!

Regarding to this reading data from the excel, I have another problem that keeps occurring. The parameters’ order in Excel must be in order with the select Revit element models in a dynamo, otherwise if I change the amount of offsets for one of the element. For example if the first row in my excel file is wall and I change the top-offset for the wall, if the first Revit selected model element in dynamo is window, the top offset of window is changing. How can I fix it.

I already use the flatten node.


Excel File-Bounding box dimensions.xlsx (9.1 KB)

Any Thoughts?
I deeply appreciated

For the wall orientation, how can I set the top offset, bottom offset to be associated the wall orientation?
Because if I go with “Object. Type” node, all of the walls would be the same type but in different orientation.
For example the top-offset in one wall would be the right offset in another wall in another direction.