Replace mutiple items at multiple indices

Hey guys ,

Can anyone help me ?
Im trying to replace multiple items at (multiple) indices. Is it possible ?

The list I would like to get is [1,2,a,4,b,6,7,8,9,10]

Nevermind guys. Found the answer here List.ReplaceItemAtIndex
There is a node in the clockwork package that does exactly what I was looking for.

Does anyone know how to get this to work ?

The list I would like to get out of this is:{ [1,2],[2,3],[a,b],[b,c] }

The key is list levels :slight_smile:

Thank you. I thought so but haven’t gotten used to using levels yet :x . Gonna try some more and look for “level” tutorials to help me get this one working.

Start by reading this :slight_smile:
http://dynamobim.org/introducing-listlevel-working-with-lists-made-easier/

1 Like

Ive just read it and tried it. Still cant get it to work with lists of lists. Have you used this specific node in that way? I would love to see the @level settings that makes this one work.

Think the Clockwork package is in need of an update to support dyn 2.x :wink:

Tried with a bunch of other nodes… i might stand corrected :wink:
(My own package “Canary” works, though I have not yet released it :slight_smile:

For now the python script below should help you :slight_smile:

lst = IN[0]
ind = IN[1]
rep = IN[2]
for i,x in zip(ind,rep):
	lst[i]=x
OUT = lst
3 Likes

I think there’s one in RIE which works?


Part of your problem was that the first value was returning null, that historically has upset dynamo core nodes.

Nice !! This is exactly what I needed. Works like a charm. Thank you!

I’ll be waiting for your canary package to test some fun nodes out :smiley:

1 Like