# Inconsistency by filtering

**URL:** <https://forum.dynamobim.com/t/inconsistency-by-filtering/8549>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [January 2, 2017, 12:37pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549 "2017-01-02T12:37:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 2, 2017, 12:37pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/1 "2017-01-02T12:37:27Z")

</div>

Hi,

sorry if the title doesn’t exactly correspond to the following problem, I had to fill it out somehow.

Imagine the following scenario:

First of all I define in revit two identity data parameters for architechtural walls called : “Wallgroup” and “ParameterX”

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/a/aaec3c38488db7b65804cb4b7c42e4997ac31710.png)

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

In Revit I have three wall goups as following:

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

Now I would like to set the **ParameterX** of all the walls in **wall group 0** to **100** , to set the **ParameterX** of all the walls in **wall group 1** to **101** and to set the **ParameterX** of all the walls in **wall group 2** to **102**.

Fetching all elements by “Select Model Elements” and sorting them I achieve this by the following Dynamo Code:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/6/26606f802f21dc614e7ff6f4db92b5a14a15c749.png)

So far so good.

Please note that I always want the ParameterX of all walls in group 0 to be 101, those of all walls in group 1 to be 102 and those of all walls in group 2 to be 103. The point here is that all of the walls in group 2 e. g. do always have to have their ParameterX to be 103, no matter if the list of e. g. wall group 1 is empty or not.

But deleting all of the walls in the group 1, I get the following problem:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/3/536104df2a8382822c7db8da4045a425635b1f3c.png)

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/80e7981bb9e5fcde5b92f270290095cb50b3eedf.png)

The number of the items in the list {101,102,103}; doesn’t correspond to the number of available wall groups anymore. What I think would be the solution is to insert something e. g. in the group list of the wall in the group 1 as a place holder, even if walls of group 1 is empty.

But I don’t have any idea how to do it. I would be very grateful for any help.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [January 2, 2017, 12:57pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/2 "2017-01-02T12:57:18Z")

</div>

You could try to use a _Springs.Dictionary.ByKeysValues_ from _spring nodes_ to associate values to all related group names before querying them

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [January 2, 2017, 1:06pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/3 "2017-01-02T13:06:11Z")

</div>

Hi @babysatch ,  
I was working on it but @Yna_Db said it first! 🙂 I think it would be the best approach :

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/51593261d76767b3f4067ff880a2e13ab54c4cb7.png)

---

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 2, 2017, 1:21pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/4 "2017-01-02T13:21:26Z")

</div>

…thank you guys. I will try it out and give you my feedback asap.

---

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 2, 2017, 2:08pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/5 "2017-01-02T14:08:16Z")

</div>

It works very nice. Thank you again.

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [January 2, 2017, 4:38pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/6 "2017-01-02T16:38:04Z")

</div>

Hi @babysatch

Option 2

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

---

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 3, 2017, 9:39am UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/7 "2017-01-03T09:39:41Z")

</div>

…I will give it a try. Thank you.

---

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 6, 2017, 6:52pm UTC](https://forum.dynamobim.com/t/inconsistency-by-filtering/8549/8 "2017-01-06T18:52:23Z")

</div>

…it works also 😉 thanks.
