# How to get list of surfaces w/ maximum area?

**URL:** <https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372>\
**Category:** Lists-Logic\
**Created:** [March 23, 2018, 3:01pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372 "2018-03-23T15:01:57Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 3:01pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/1 "2018-03-23T15:01:57Z")

</div>

fairly simple issue but i’m stuck here

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/3/73c02de2f16850ead690127fa15c73ef7051619f.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:** [March 23, 2018, 3:07pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/2 "2018-03-23T15:07:10Z")

</div>

Notice your item at index [0][0] for the surface area and index [0] don’t match. This is because you’re working with a float which is less stable.

Round your values before you get the maximum value so that you’re comparing integers instead to prevent this.

---

<div class="post-metadata">

**Author:** ![alvpickmans](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alvpickmans/32/41236_2.png) [@alvpickmans](https://forum.dynamobim.com/u/alvpickmans)\
**Post date:** [March 23, 2018, 3:10pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/3 "2018-03-23T15:10:31Z")

</div>

Or sort them (ascencing order) and take the last item of each nested list.

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 3:26pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/4 "2018-03-23T15:26:54Z")

</div>

thanks all, seems both rounding and sorting doesn’t work, but my logic (of list handling) is correct, right?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/3/73057d546ed1b96e489d33e74e267cf92e21859a.png)

---

<div class="post-metadata">

**Author:** ![tiagocorradi](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@tiagocorradi](https://forum.dynamobim.com/u/tiagocorradi)\
**Post date:** [March 23, 2018, 3:36pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/5 "2018-03-23T15:36:10Z")

</div>

I think that @alvpickmans said is something like this:

 ![Forum](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/7/e7afae93dfaaf5919e8076ac5c67aa26158f359c.png)

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 3:43pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/6 "2018-03-23T15:43:25Z")

</div>

right, it works, thanks.  
but how to get the index from original list? in fact, i just want to get the face list w/ maximum area, not area itself

---

<div class="post-metadata">

**Author:** ![tiagocorradi](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@tiagocorradi](https://forum.dynamobim.com/u/tiagocorradi)\
**Post date:** [March 23, 2018, 3:47pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/7 "2018-03-23T15:47:18Z")

</div>

Try to change the “element” input of indexOf node to @L1

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 3:51pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/8 "2018-03-23T15:51:15Z")

</div>

not working, warning: argument is invalid

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 4:26pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/9 "2018-03-23T16:26:48Z")

</div>

i used another method, seems working now

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/c/2c5fe0f8eaed5e21140581ddeca5250acefc7340.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:** [March 23, 2018, 7:34pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/10 "2018-03-23T19:34:23Z")

</div>

@tiagocorradi - what Dynamo version are you using?

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 7:36pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/11 "2018-03-23T19:36:01Z")

</div>

1.3.2

---

<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:** [March 23, 2018, 7:37pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/12 "2018-03-23T19:37:45Z")

</div>

Auto lacing isn’t in the supported 1.3.2 though… unless I missed something.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/f/7fa13b42d43d2b98af7570c1045db4b63cd3c82f.png)

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 7:40pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/13 "2018-03-23T19:40:40Z")

</div>

no auto lacing, but my Dynamo is most updated, isn’t it?  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/7/f7423d41c8dc22ecf23048034357afeaf0599e64.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:** [March 23, 2018, 7:48pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/14 "2018-03-23T19:48:28Z")

</div>

ah! I asking @tiagocorradi, not you @Ning_Zhou. Sorry for the confusion.

These are the two methods discussed above working off of a simulated data set. The idea behind the math.round is to prevent the bad data reads which can happen when pulling Revit data and converting units.

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

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [March 23, 2018, 8:05pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/15 "2018-03-23T20:05:34Z")

</div>

right, float value is always dangerous, thanks and have great weekend!

---

<div class="post-metadata">

**Author:** ![Nico\_Stegeman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nico_stegeman/32/19204_2.png) [@Nico\_Stegeman](https://forum.dynamobim.com/u/Nico_Stegeman)\
**Post date:** [March 23, 2018, 8:13pm UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/16 "2018-03-23T20:13:00Z")

</div>

What is auto lacing? I have never seen it before.

---

<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:** [March 24, 2018, 1:44am UTC](https://forum.dynamobim.com/t/how-to-get-list-of-surfaces-w-maximum-area/20372/17 "2018-03-24T01:44:13Z")

</div>

Something which appears to only have made it into the daily builds. I’m not yet comfortable enough to speak on it. Perhaps someone else more familiar will speak up on this, but might be best to wait until it’s commonly available before you start to worry. 😉
