Replace all values of a sublist with given sublist

Almost, but I do not want list 1…3 at level 4 below to read 3,3,3.

The only entry that needs to change is in list 0

See below:

I’m not all satisfied with this solution, as you gain another level to your lists…

The “index” input is {0,0} meaning {outer-list-index, inner-list-index}

This will require you to add a “flatten” node…

intesrting, that would do the trick.

is that node in the orchid package? is this package only supported in dynamo 2.0? I am on 1.3 and it fails to yield any results when I search for orchid.

Thanks for all your help @Jonathan.Olesen!

No it is available for both (I’m in 1.3.2 as well), but you’ll have to look in the package and carry out the installation from github :slight_smile: Instructions are included in the download from the package manager :slight_smile:

I’m on an ancient version of Orchid however, I know it have been re-coded to zero-touch node since :slight_smile:

1 Like

Thanks tried to follow the instructions and removed all of my packages haha.

I am terrible with computers :smile: always seem to mess things up hahah.

I will try the process again.

There should be an executible installer (.exe) as well, which can help you… :slight_smile: Mind that both dynamo and revit should be closed when you execute it :slight_smile:

These two will help as well:

1 Like

I see there is a nice .gif as well of what I need to do.

Alternatively I created a small python script to replace at index in two dimensions a while back that might be able to accomplish your objective :slight_smile:

Redid the install, feel like I did it wrong though even though I have elements within the orchid package now.

Results do not match yours, I might explore the python script.

Thanks for all your help

@austin.guter Would this work for you?

replace.dyn (11.1 KB)

1 Like

@Jonathan.Olesen any idea why my orchid node yields differing output than yours?
This node looks promising.

I’ve attached the dyn file as well for reference.

working with indcies and assigning values.dyn (7.2 KB)

@Vikram_Subbaiah your method works as well.

to add another layer to this, ultimately i would like to make the indices a list of lists.

for example see below. not sure how this would work but i am sure it can be done.
lets say the first entry is replace index (0,0) with values (2,2) and the second entry is to replace index (1,1) with (1,1).

the two nodes I am using, do not do this correctly. end result should look like:

It must have happened when the package was recoded from Python to C#, as I said my package is old (one of the first versions) and I will not update it till my current project is finished :slight_smile:

But you can, as I mentioned earlier, use python to accomplish your task :slight_smile:

Pos = IN[0]
Val = IN[1]
OrgLst = IN[2]
for (L,P),V in zip(Pos,Val):
	OrgLst[L][P] = V
OUT = OrgLst
1 Like

@Jonathan.Olesen, appreciated, the python script does the trick.

@austin.guter, can I ask what is the difference… there should be no difference between what @Jonathan.Olesen do and you do… it should be the same. Please elaborate so I can find what could be the problem.


You should be able to see the difference in my first snapshot (15th post on the topic). The upper portion is the orchid pacakge exampe and it yields an odd lists of lists (still not sure what it is doing), while @Jonathan.Olesen orchid package does what I wanted to achieve.

Let me know if you need any more info.


I am taking with @Jonathan.Olesen about it. I talk with him very regular so I will try to figure with him what could be the problem

1 Like

Now I got the problem, and it is how to feed the node there is the problem, let me explain.

If I want to change sublists with individual elements, then I need to “cut” the list to this level. In this case is list level 3 the cutting range. Since I want to change element 0 and 1 in the first sublist (level 3), then I need to feed this as [[0,0],[0,1]] and the two items I want to put in can be set as ["a","b"]. However, since I dont write [["a","a"],["b","b"]] I add yet another list level for the items (level 2). Lastly use flattern to get the same list structure.

GetItemAtIndex.dyn (15.2 KB) --> dynamo 2.1.0

1 Like

so to answer this post

you can do it like this
GetItemAtIndex2.dyn (15.2 KB) --> dynamo 2.1.0

But as @Jonathan.Olesen describes in the below post. If you have the control over the list depth, then you can hardcode it with python.

My node is made to solve nD list issues there can solve any list depth :slight_smile:

Appreciate the response @erfajo. What you have shown makes sense.