# How to sort rebar

**URL:** <https://forum.dynamobim.com/t/how-to-sort-rebar/89168>\
**Category:** Revit\
**Created:** [May 2, 2023, 4:58pm UTC](https://forum.dynamobim.com/t/how-to-sort-rebar/89168 "2023-05-02T16:58:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![d.kelfkens](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/d.kelfkens/32/161060_2.png) [@d.kelfkens](https://forum.dynamobim.com/u/d.kelfkens)\
**Post date:** [May 2, 2023, 4:58pm UTC](https://forum.dynamobim.com/t/how-to-sort-rebar/89168/1 "2023-05-02T16:58:04Z")

</div>

Hi All,

I’m stuck on something that might be not that hard to solve.  
I’m trying to create a sorted list with rebar. Each level is an element (in my case a concrete beam) which contains rebar. With the filterbyboolmask only the last element is used for sorting out my rebar.  
Can you point me in the right direction?

 ![sort rebar list](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/4/34ca2bdaffeafddc316777064a4e89bf2a88ddd9.png)

---

<div class="post-metadata">

**Author:** ![d.kelfkens](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/d.kelfkens/32/161060_2.png) [@d.kelfkens](https://forum.dynamobim.com/u/d.kelfkens)\
**Post date:** [May 2, 2023, 5:57pm UTC](https://forum.dynamobim.com/t/how-to-sort-rebar/89168/2 "2023-05-02T17:57:55Z")

</div>

could this be it?

 ![sort rebar list 2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/8/c8061039f4e5bb8e8b182c5ac8083bf60d8d6dd3.png)

---

<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 2, 2023, 7:34pm UTC](https://forum.dynamobim.com/t/how-to-sort-rebar/89168/3 "2023-05-02T19:34:04Z")

</div>

Hi @d.kelfkens ,

By what exactly do you want to filter your list? Are you only after the Rebar Elements?

---

<div class="post-metadata">

**Author:** ![d.kelfkens](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/d.kelfkens/32/161060_2.png) [@d.kelfkens](https://forum.dynamobim.com/u/d.kelfkens)\
**Post date:** [May 3, 2023, 5:36am UTC](https://forum.dynamobim.com/t/how-to-sort-rebar/89168/4 "2023-05-03T05:36:48Z")

</div>

Hi @Daan,

Yes I’m only after the Rebar elements sorted per beam.  
I’m working on an automated Rebar schedule export.

---

<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 3, 2023, 6:09am UTC](https://forum.dynamobim.com/t/how-to-sort-rebar/89168/5 "2023-05-03T06:09:11Z")

</div>

Then yes, List.GroupByKey would be best here. I recommend using the element ID rather than the element as that will be a lot more robust.
