List.Map on List.AllIndiciesOf (using levels) not working?

Hello all,

I’m attempting to use List.Map with List.AllIndiciesOf @L2.

Here is the working version (list structure is 120 lists each containing 120 bools)

Here I have the same list structure except for I have multiple lists of the working version above (5 lists of 120 lists each containing 120 bools)

Please note Python Script is same function as Geometry.DoesIntersect node in first screenshot except it handles my extra lists.

From what I understand my second screenshot should work the same as the first on all 5 of my lists but it is returning Empty List.

Please let me know if you see what I am missing. Thanks in advance!

Unless I’m missing something, it should, if you eliminate List.Map (not sure as to why it was introduced) and connect the output of your Python node to the input port (list) of List.AllIndicesOf. Just as you’ve done in the working version.

If I do this I lose my desired list structure of 5 outer lists. Perhaps I could use List Chop to recreate the list structure but I would have thought the Map would have worked.

I believe I will attempt a Python solution using this method instead:
image

Have you tried checking Keep List Structure (if list doesn’t work try checking item)?
listStructure

1 Like

Yes, that seems to work.

I thought I had attempted that, but I must have gotten that confused with another part of my graph.

There are other parts of my graph where I had to use Map for List.Flatten & List.Transpose, I believe those were the ones where keep list structure was not working for me.

image

Thank you for your help Vikram! Have a great day!

1 Like

From my experience, the “Keep list structure” function can be a bit buggy sometimes, if you’ve already run the graph, and then attempt to set it.
If it’s not working as expected, then unplug inputs from the node where you want to keep the list structure, set the “Keep list structure”, run the graph without inputs in the node, and then replug the inputs.

Worked for me atleast :slight_smile:

2 Likes

It’s definitely buggy. I’ve found that changing the list level, running the graph, and then setting it back will fix it.