Replace all values of a sublist with given sublist

In my simplified example,

I am trying to replace the values in the 0th list @ level 3 and the 0th list @ level 2 with all 3 values (using the clockwork node list replace item at index node):

Is there a simple way I can do this?

Thanks,
S&T

Feels like I need two inputs for my indices, essentially replace items at index (0,0). Is there a way to do this?

Thanks,
S&T

Like so?:
image

It can be done a few different ways depending on your preferences in lacing/list-levels.
image

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:
image

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:

https://forum.dynamobim.com/t/orchid-package-released-at-github/22671

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:
Capture%202

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.

@erfajo,

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.

Thanks

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