How to replace nested lists?

I’m not sure if I’ve phrased the question correctly, but I’m wondering if it is possible to replace selected indices within a nested list as shown in the image I have included. So far, I don’t seem to be able to replace the five sublists within the main list.

Thank you in advance for any help!

hi @Pschelechow_MPS

try this script replace_at_index.dyn (6.1 KB)

a

2 Likes

This is fantastic! Thank you so much for your help! This is exactly what I was attempting to accomplish.

I feel fairly inept especially since the code looks so simple. Is there a particular reason that the native node in dynamo for “list replace item at index” doesn’t perform in the same way?

Hi @Pschelechow_MPS

The node List.ReplaceItemAtIndex I think only replaces an item once at a time that is why it does not behave the way you want it to behave.

-biboy