List.IndexOf not giving desired Result

Hi All,
If you see my Script, I have 75220016 in both my list but List.IndexOf is not able to read it, I don’t know why.
May be because it is a number ? Because once I add -1 in both of my list’s, it starts reading it.
Is there a solution to it?


You should add an object.type node after Excel Sheet Number and Revit Sheet Number to see what kind of type (string, double, …) you’re trying to compare.


My first guess would be that the top numbers of “Excel_Sheet Number” are strings, while the “Revit_Sheet Number” are integers… By adding “-1” you’re transforming it to a string :slight_smile:


Edit… You beat me to the punch @Alban_de_Chasteigner :grin:



I tried Changing Excel Numbers to String, it didn’t helped,
now I don’t know how the change the parameters properties of Revit Sheet Number since it’s an Inbuilt parameter.


Showing your attempts will make it immensely easier to assist you :slight_smile:

We are going well,

When converted to string my excel Shows 000000, and that is where the problem is.
How Can I solve this one now. :slightly_smiling_face:

The trailing zero’es comes from transforming a double (e.g. 2.0) to a string… (dynamo stuff)…

1 Like

Instead I used a Node from archilab & converted my Revit Sheet Numbers toDouble & It’s working,
Thanks for your affort @Jonathan.Olesen.

im getting this issue but its not a data type issue. when i have auto lacing it returns the first index properly but if i set it to Longest it changes to -1 for the index i dont want and 0 for indexes i do want but it doesnt give me the indexes