# List Creation

**URL:** <https://forum.dynamobim.com/t/list-creation/18051>\
**Category:** Revit\
**Tags:** revit, dynamo, rooms\
**Created:** [January 11, 2018, 7:30am UTC](https://forum.dynamobim.com/t/list-creation/18051 "2018-01-11T07:30:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewcomerDY](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@NewcomerDY](https://forum.dynamobim.com/u/NewcomerDY)\
**Post date:** [January 11, 2018, 7:30am UTC](https://forum.dynamobim.com/t/list-creation/18051/1 "2018-01-11T07:30:59Z")

</div>

Hi all,

I’m checking which rooms (central files) the elements (linked files) are located at. I need to assign the room name to the respective elements in the linked files. Currently I have two lists, the rooms and the elements in the rooms. I’m thinking about creating a list shown in the red box but I’m not sure how to create it. Appreciate if someone can help me with that. Thank you!

 ![Element in Room](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/7/2781f566be8fdcdd54010574bad01d5c407c0350.PNG)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 11, 2018, 7:38am UTC](https://forum.dynamobim.com/t/list-creation/18051/2 "2018-01-11T07:38:06Z")

</div>

Can’t test it at the moment but something like this might work?

```
roomList = IN[0]
eleList = IN[1]

eleInRoom = [[],[]]
for i in range(len(eleList)):
    eleInRoom[0].append([])
    eleInRoom[1].append([])
    for j in range(len(eleList)):
        eleInRoom[0][i].append(roomList[i])
        eleInRoom[1][i].append(eleList[i][j])

OUT = eleInRoom
```

---

<div class="post-metadata">

**Author:** ![khuzaimah.ElecEng](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khuzaimah.eleceng/32/92768_2.png) [@khuzaimah.ElecEng](https://forum.dynamobim.com/u/khuzaimah.ElecEng)\
**Post date:** [January 11, 2018, 7:39am UTC](https://forum.dynamobim.com/t/list-creation/18051/3 "2018-01-11T07:39:36Z")

</div>

HI ,  
you can get Count of the element list using **Count Node** with L2, Then **List.Cycle** the Rooms With Amount of **Count** Result

---

<div class="post-metadata">

**Author:** ![NewcomerDY](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@NewcomerDY](https://forum.dynamobim.com/u/NewcomerDY)\
**Post date:** [January 11, 2018, 10:04am UTC](https://forum.dynamobim.com/t/list-creation/18051/5 "2018-01-11T10:04:23Z")

</div>

@kennyb6 Sorry I’m new to dynamo and not really familiar with the script but I will try it again when I’m familiar with it. Thanks for your help!!! 🙂

@khuzaimah.ElecEng It works! Thank you so much!!! 🙂

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [January 12, 2018, 12:59am UTC](https://forum.dynamobim.com/t/list-creation/18051/6 "2018-01-12T00:59:01Z")

</div>

No problem. For future reference, that is a python script. Just make a python node, double click it and paste it under where it says to put inputs (delete the data… variable first).
