List.GetItemAtIndex is not correct index

Hello everyone!

I have an issue that I can’t resolve at the end of my routine:

The “getitematindex” list is displaying the wrong index.
As shown, ID8794094 is to be displayed instead of 8775339
Does anyone have any suggestions what it might be? I believe I’m a sublist, but I didn’t get an option that works

Are you trying to get an element ID with an element?

try with element to element or ID with ID

I’m not really sure what you’re doing… you only show the outputs for one node before your final result. You show the element at index 54 for the original list, but you don’t explain at all how that translates to your final outcome. All we can see is that you’re using GetItemAtIndex with a list of doubles (which get rounded to integers) and those are returning the expected elements. Please show the rest of the node previews and explain why you think you should be getting a different result.

Thanks for reply.
I didn’t understand how I’m going to modify it according to what you said
But I’m trying to get the ID of these elements (the correct IDs were to be the ones I added the codeblock to the image), but others are coming out

Thanks for reply @Nick_Boyts

I’m checking the height of my ducts that are below a certain value


I grouped it to improve the visualization and I’ll leave the file if it do it easier, because I don’t know how to explain it better

test.dyn (37.4 KB)

You’re filtering the elevation values and then using them as the index. I’m guessing that’s not what you actually want. I’m assuming you actually just want to filter the list of non-vertical conduits. That would give you all conduits above or below 2.5.

1 Like

That’s right @Nick_Boyts, after filtering the non-verticals (its ok), I use this list to check which ones are below 2.5
I got a list of your elevations, but I wanted their ID to be shown (since the ID that currently comes out doesn’t agree)

Try this:


Awesome! Worked perfectly @Nick_Boyts
Thanks for the correction, it’s now finished for me to use.