# Counting list length

**URL:** <https://forum.dynamobim.com/t/counting-list-length/55171>\
**Category:** Developers\
**Created:** [September 15, 2020, 7:11pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171 "2020-09-15T19:11:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [September 15, 2020, 7:11pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/1 "2020-09-15T19:11:30Z")

</div>

I think the answer is going to make me feel really stupid and I’m going to have to blame it on being on holiday for the last 3 weeks and other lame excuses but…

How do I get it to count the lower level so the output on my python node is 9 and not 1?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/e/8e80fa8bc7e1384a64cc84ec0e732e30e4da83b8.png)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [September 15, 2020, 7:12pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/2 "2020-09-15T19:12:35Z")

</div>

List.Count node.

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [September 15, 2020, 7:15pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/3 "2020-09-15T19:15:35Z")

</div>

I want to do it in python.

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [September 15, 2020, 7:18pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/4 "2020-09-15T19:18:40Z")

</div>

Since you are feeding it a list of lists, you need to get the first item in the list, or you need to flatten it before.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/1/b19dacec6ca8e8deb1c04103189b06b7b645ead1.png)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [September 15, 2020, 7:23pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/5 "2020-09-15T19:23:49Z")

</div>

So I just needed to unwrap it?

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/4/c41c683c406ddea40aab02dd5b127ee93dfcea77.png)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [September 15, 2020, 7:26pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/6 "2020-09-15T19:26:33Z")

</div>

Ah, no… ignore me…

Told you… been on holiday, brain is still away 😃

I need the [0] not the unwrap!

doh! Thanks 🙂

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [September 15, 2020, 8:31pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/7 "2020-09-15T20:31:09Z")

</div>

Oh yeah, sorry about that, my default python template automatically unwraps everything and i didn’t think to look at it!

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [September 17, 2020, 9:59pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/8 "2020-09-17T21:59:41Z")

</div>

Are there cases where you wouldn’t want things unwrapped? If so would you be kind enough to give me an example 🙂

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [September 17, 2020, 10:11pm UTC](https://forum.dynamobim.com/t/counting-list-length/55171/9 "2020-09-17T22:11:39Z")

</div>

Unwrapping the (Revit) elements gives you access to their Revit properties. If your just sorting or filtering them or if the inputs aren’t Revit elements then the unwrapping isn’t doing anything.
