# Get doors by number(s), how?

**URL:** <https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401>\
**Category:** Revit\
**Created:** [September 1, 2023, 1:07pm UTC](https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401 "2023-09-01T13:07:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [September 1, 2023, 1:07pm UTC](https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401/1 "2023-09-01T13:07:23Z")

</div>

Hello,

i stuck mentaly here … 🙂

`["O2520-T01","O2530-T01","O2503-T01","O2505-T01","O2800-T01","O2542-T01","O2540-T01","O2540-T01","O2545-T01","O2547-T01",;`

i want to get this doors in my current view, how ?

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

i need just to create a bool and filter them out.

KR

Andreas

---

<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:** [September 1, 2023, 1:25pm UTC](https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401/2 "2023-09-01T13:25:38Z")

</div>

Instead of a set difference, List.Contains where the list is the numbers you are after, and the item is the parameter value of each door (make sure you have the item set to @L1 as it will otherwise look for a list of parameter values in your list). From there you should have a flat list of boolean values which can be used as a mask in a FilterByBoolMask node.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [September 1, 2023, 1:37pm UTC](https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401/3 "2023-09-01T13:37:07Z")

</div>

@jacob.small ,

is there also a listlength to take in mind ?

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/5/9581584278c04f6619578b51bc09ed604e264408.png)  
KR  
Andreas

---

<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:** [September 1, 2023, 1:47pm UTC](https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401/4 "2023-09-01T13:47:12Z")

</div>

Hi @Draxl_Andreas

> [@Draxl\_Andreas](#):
>
> want to get this doors in my current view, how ?

How about pythonic way?

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

```auto
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

toList = lambda x : x if hasattr(x, ' __iter__') else [x] 

names = toList(IN[0])

# Filter Doors in Active View and by Mark Value
filter_doors = [x for x in FilteredElementCollector(doc,doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_Doors)
.WhereElementIsNotElementType().ToElements() 
if x.get_Parameter(BuiltInParameter.ALL_MODEL_MARK).AsString() in names]

OUT = filter_doors

```

---

<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:** [September 1, 2023, 1:50pm UTC](https://forum.dynamobim.com/t/get-doors-by-number-s-how/93401/5 "2023-09-01T13:50:49Z")

</div>

Inputs are backwards; the hard coded acceptable values are the list input. They should not have list levels enabled, or be set to @L2. The item input is the the parameter values (not sure you need the `x+""` code block). They should be @L1. Lacing should work on Auto (as you are using an @L1 one of the inputs is a single item, so Auto will kick over to longest), but if not longest will work if not.
