# How to combine sublists such that 0index of second list will come after 0index of first list and so on

**URL:** <https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827>\
**Category:** Lists-Logic\
**Tags:** revit, dynamo, list-filter\
**Created:** [May 19, 2020, 11:58am UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827 "2020-05-19T11:58:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 11:58am UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/1 "2020-05-19T11:58:57Z")

</div>

Hey, i am new to dynamo and trying to combine 2 lists in the picture below. I have 2 lists. First, with 2 elements, 2nd with one element sublists. I want to add the 2nd list with one element sublist such that all the elements will be at the middle index of the 1st list in the same sublist category.  
If it is possible to combine such that 0index of 2nd list will will come after 0index of 1st list and so on that also fine after that i can chop them into a sublists of 3list.

 ![Screenshot (73)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/5/151927a7aecfd2277864cc2aaeaf795820797876.png)  
[Myway.dyn](https://forum.dynamobim.com/uploads/short-url/qcXt8Q2FtNO6cCaX3Ztpe2ulNcV.dyn) (51.4 KB)

A little bit background for this project. I want to make a list with 3 pointed (start, mid, end) sublist on the curved path i have defined. I want 3 pointed sub list for 3point adaptive bridge family.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 19, 2020, 12:22pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/2 "2020-05-19T12:22:43Z")

</div>

[https://dictionary.dynamobim.com/#/BuiltIn/Action/Insert(list\_var[]..[]-element\_var-index\_int)](https://dictionary.dynamobim.com/#/BuiltIn/Action/Insert(list_var%5B%5D..%5B%5D-element_var-index_int))

Watch your list levels, I think @L2 and @L1 will do the trick.

---

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 12:24pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/3 "2020-05-19T12:24:38Z")

</div>

can you please elaborate a bit please, I know levels but what node will make it happen?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 19, 2020, 12:29pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/4 "2020-05-19T12:29:40Z")

</div>

Check the link I posted above. 🙂

---

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 12:36pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/5 "2020-05-19T12:36:58Z")

</div>

I have tried it but couldn’t achieve what i want. I inserted 2nd list(with one element) into a 1st list. And by adjusting levels it produced many things but a nested list with 3 elements

---

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 12:46pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/6 "2020-05-19T12:46:31Z")

</div>

@jacob.small, with the help of yours I have achieved what i want thank you very much. Do you think this is efficient way to do it? or is it very bad scripted? Below is the picture of how I did it

 ![Screenshot (75)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/b/6b134ff4d5a5bb4d14aae3cf1815fbc19f2bce05.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 19, 2020, 12:53pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/7 "2020-05-19T12:53:00Z")

</div>

Well it certainly works. Where are the points originating from? Zoom in so you can easily read the nodes and then use the little camera button in the top right corner, and upload the image which is saved.

---

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 1:21pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/8 "2020-05-19T13:21:35Z")

</div>

I really didnt get what is your question. Nodes seem to be clearly seen. You want me to zoom in or out the background? or zoom out the nodes to see all other nodes? I will attach the dynamo file if you want to check it. I have divided it into 3 points but i coudn’t make a bridge I wanted. and I dont know the problem yet. Below are the files and pictures. [Bridge Adaptive 3 points type A.rfa](https://forum.dynamobim.com/uploads/short-url/CnG4j2HbTKBJvXS1UVTAQ3qMfx.rfa) (976 KB) [Myway.dyn](https://forum.dynamobim.com/uploads/short-url/20fvfJG0eMKvk4dFJpgcT5lfKeU.dyn) (66.1 KB)

 ![Screenshot (76)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/f/0fc9ad109c3098133f22d2b16654c377df3fbfdb.png) ![Screenshot (77)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/7/978cae3eb55c06d871e688896e68c7aea82e9435.png)

The problem might be from the bridge family i used. I was trying to recreate the Dynabridge package, since it is not working properly with later revit versions. I wanted to do it manually, however, I am struggling very much.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 19, 2020, 1:33pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/9 "2020-05-19T13:33:47Z")

</div>

![0fc9ad109c3098133f22d2b16654c377df3fbfdb](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/1/0185ce8b38acf0b56142ba82af169ff5477a5d1c.jpeg)

That button.

My thought is that there may be a better way to gather your points.

---

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 1:50pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/10 "2020-05-19T13:50:06Z")

</div>

Here it is. I have edited. so that my thinking process will be much clearer. Here, is what i want to achieve. I want to trace the bridge deck along the curved path I have defined with adjustable point in the middle. For that i need 3 points (start, mid, end). I have done all the things required, however, final solution is wrong. It seems stemming from the adaptive famili componenet, which i took from internet. Below is the pictures.

 ![Myway_rev1_2020-05-19_05-54-52](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/9/f95f02b0e7df5961136fc47e26d126f5f0bb207e.png)  
 ![Screenshot (79)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/b/5b9e9bc0c4b85749569d3439cace4021259cbbc9.png)

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [May 19, 2020, 3:01pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/11 "2020-05-19T15:01:29Z")

</div>

Just as @jacob.small said.

> [@jacob.small](#):
>
> I think @L2 and @L1 will do the trick

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/d/5d67e8fe8bce688b26e299eec7d01f7a4fe69915.png)

---

<div class="post-metadata">

**Author:** ![arslan.chariyev](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arslan.chariyev](https://forum.dynamobim.com/u/arslan.chariyev)\
**Post date:** [May 19, 2020, 3:06pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/12 "2020-05-19T15:06:23Z")

</div>

I have updated my script above, can you check it and comment on it? I achieved what i wanted from list but the final bridge isn’t right. I am assuming it is because of the adaptive family component, since I took it from internet (I dont know how to do them yet).

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [May 19, 2020, 4:03pm UTC](https://forum.dynamobim.com/t/how-to-combine-sublists-such-that-0index-of-second-list-will-come-after-0index-of-first-list-and-so-on/50827/13 "2020-05-19T16:03:09Z")

</div>

If you are talking about the post above mine your list levels are still not correct.
