# Multiple List sorting

**URL:** <https://forum.dynamobim.com/t/multiple-list-sorting/76788>\
**Category:** Revit\
**Tags:** revit, archi-lab, python, dynamo\
**Created:** [May 23, 2022, 4:27am UTC](https://forum.dynamobim.com/t/multiple-list-sorting/76788 "2022-05-23T04:27:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chhabrat](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@chhabrat](https://forum.dynamobim.com/u/chhabrat)\
**Post date:** [May 23, 2022, 4:27am UTC](https://forum.dynamobim.com/t/multiple-list-sorting/76788/1 "2022-05-23T04:27:55Z")

</div>

Hello Dynamo Gurus,

I have a quick question regarding sorting lists, I am placing multiple views on multiple sheets referencing different viewports. So I have three different lists, I want them to be in a same order. is that possible?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/2/5255723f33d08bafa366e7ac1490ec78032ac4e7.jpeg)  
It’s a bit tricky to explain. The method I was using, It was working fine with only Ground Floor plans but now I have First Floors too.  
All I want these lists to achieve their corresponding values.  
Thanks

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [May 23, 2022, 3:11pm UTC](https://forum.dynamobim.com/t/multiple-list-sorting/76788/2 "2022-05-23T15:11:55Z")

</div>

Hi @chhabrat ,

See if this node helps out:  
[https://dictionary.dynamobim.com/2/#/BuiltIn/Action/SetIntersection](https://dictionary.dynamobim.com/2/#/BuiltIn/Action/SetIntersection)

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 23, 2022, 3:46pm UTC](https://forum.dynamobim.com/t/multiple-list-sorting/76788/3 "2022-05-23T15:46:12Z")

</div>

@chhabrat@Daan ,

…intresting,

what is the intersection between views and sheets there originpoint? or is there a boolean “I am placed on a sheet” ?

```auto
def intersection(lst1, lst2):
    lst3 = [value for value in lst1 if value in lst2]
    return lst3
 
lst1 = IN[0]
lst2 = IN[1]
OUT = (intersection(lst1, lst2))

```

 ![2022-05-23_17h46_05](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/7/f722b9c5d65f69c0b227c4a7bc73c2c020d07c04.png)

---

<div class="post-metadata">

**Author:** ![chhabrat](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@chhabrat](https://forum.dynamobim.com/u/chhabrat)\
**Post date:** [May 24, 2022, 5:19am UTC](https://forum.dynamobim.com/t/multiple-list-sorting/76788/4 "2022-05-24T05:19:58Z")

</div>

nah, didn’t work… In the end I had to split the script into two halves. FF and GF, then it worked fine. I am not sure why it wouldn’t work together.  
Thanks anyway for your time guys. I really appreciate it.
