Get item at index + Empty List

Hello
I would like to know why I get null when the first index is “Empty List”?
Thanks.

Hi @outmanechamekh

here you try to pass empty lists to the node that accepts only integers according to the node description. You need to get rid of the empty lists and after to flatten.

Thanks for your answer, but when the first item is not “epmty list” it works, even though I have other items that are “empty list”.

What version of Dynamo are you using? I thought I remembered this being fixed but I may be mistaken. It’s an issue that I would guess stems from the node not being able to determine the appropriate list structure to use or possibly an issue with rank reduction with the first item being an Empty List (or null), but either way is a known issue. The easiest way to work around it, as well as avoid potential errors, is to filter all Empty Lists first.

Dynamo core 2.1.0.7500
Dynamo revit 2.1.0.7733

What does your error say? I’m in 2.0.3 and it works fine.
image

1 Like

Make sure you’re using the core node and not a similar one from a custom package.

Warning:List.GetItemAtIndex expects the argument type(s) (var, int), but was called with (Revit.Elements.Element, int).

Yes , i use the core node

Odd. You can try forcing the index to use @L2 but honestly you’re still better off filtering the Empty Lists.

1 Like

I filtered the lists and it worked.
Thanks