List.IndexOf not giving desired Result


#1

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?

Thanks.


#2

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.


#3

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:

Example:



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


#4

Thanks

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.

Thanks


#5

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


#6

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:


#7

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


#8

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