Insert sublist into another sublist with specific indexes

Hello everyone!

I was searching in the forum, but I haven’t found what I need.

I have a comparison, and depend of this, It will be inserted to the main list [{{“aa”},{“bb”},{“cc”},{“dd”},{“ee”}}] one sublist or another [{“parameter1”,1,2,3},{“parameter2”,11,22,33}…].

I tried to use the node “Insert” with the levels and the lacing. If I run it with the shortest way, the final list doesn’t have the last elements. If I run it with the longest way, the final list has the last elements, but with the sublists that they don’t have to have.

Below I attached the file.

Any input would be greatly appreciated.

Thank you all!

Insert sublist.dyn (29.5 KB)

What version of Dynamo are you working with? Several of the node names don’t match and one doesn’t resolve at all (List.Replace).

I’m not entirely sure what you’re trying to accomplish to be perfectly honest… Which list do you want to insert where? Based on what condition?
Could you provide a concrete example of what you want your final list to look like?

Is this maybe what you were looking for? It’s made in Dynamo 2.0 but I don’t think I used any nodes that don’t have an equivalent in earlier versions…

Hi @Avz !

First of all, thank you for your answer.

I’m working with Dynamo 1.3.2 and Revit 2017.

With the comparison 1 I would like to add the sublist 2 to the main list 3.

The list I need help with is

{{"aa",{"parameter2",11,22,33}},{"bb",{"parameter3",111,222,333},{"parameter4",1111,2222,3333}},{"cc"},{"dd",{"parameter1",1,2,3},{"parameter6",111111,222222,333333}},{"ee"}};

Final%20list%20(ok)%201

Thank you!

@VictorTrevijano
This should have you covered!
I’d upload the .dyn but you wouldn’t be able to open it… So you’ll have to just replicate this, but shouldn’t be a problem I think :smiley:

You can use a List.Clean node to get rid of the empties at the end if you need :slight_smile:

Edit: it wouldn’t let me override the image so I uploaded the wrong one oops… Fixed now!

1 Like

It works perfectly @Avz!

Thank you so much.

For Dynamo 1.3.2 I change the last List.AddItemToEnd (Lacing and Level)

1 Like