I’m exporting some info to Excel and then later reading it back in.
The problem I’m having right now is with Element IDs.
I thought I was doing List.IndexOf (or List.AllIndicesOf) wrong, but it turns out that when I read the IDs in from Excel, they come in as Doubles, but when I get an Element ID from Revit, it’s an Integer. So they don’t match.
I tried getting around it by setting the readAsStrings option in the Excel.ReadFromFile node, but that’s a global setting, and I have other cells I need to have as numbers.
I’ve also tried Math.Round, but that can’t handle arrays, just single values.
OK, I found the String.ToNumber node, which helps a bit.
But, still: YEEESH I have to jump through a LOT of hoops converting things back and forth just to compare a number with a decimal to an integer, even if they are have same value.
If Math.Round could handle a List, or if IndexOf could compare a Double and an Integer, I could take a dozen nodes out of my graph.
Thank you for this Einar! The 2’nd option worked fantastic for me! This was precisely the last key in a script that I’ve been thinking about for two days!! Will save us countless hours of time in the future