I am currently trying to find the next level from a list of level elevations below a specific different elevation. The python script I wrote works fine if I put in a double from a code block. But the elevation I actually want to put in (coming from an element) does not show the desired outcome.
I couldn’t really name the problem, therefore I was not able to find anything similar in the forum, but maybe you guys can help? What did I do wrong?
Thanks you guys for the quick help. Both workarounds work fine, although I prefer the approach by @Fiesta.
I still wanted to find out what causes the problem I had and dug deeper. I found out that if you convert the double into a string by python, the number is somehow not 0.105 as expected, but 0.10499999999995. This way, it found the wrong level elevation. So I just added 0.00001 to the element elevation and everything works just fine.