# Get Id of Parameter

**URL:** <https://forum.dynamobim.com/t/get-id-of-parameter/80752>\
**Category:** Revit\
**Tags:** python\
**Created:** [September 7, 2022, 8:29am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752 "2022-09-07T08:29:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![theshysnail](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/theshysnail/32/146653_2.png) [@theshysnail](https://forum.dynamobim.com/u/theshysnail)\
**Post date:** [September 7, 2022, 8:29am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/1 "2022-09-07T08:29:53Z")

</div>

How do I get the `Id` of a parameter, say `Comments`?  
I want to filter all elements having a specific parameter value.

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

```auto
commentPara = BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS
filterRule = ParameterFilterRuleFactory.CreateEqualsRule(commentPara.Id, "Hello", True)
pFilter = ElementParameterFilter(filterRule)

FilteredElementCollector(doc).WherePasses(pFilter).ToElements()

OUT = commentPara.Id

```

---

<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 7, 2022, 9:00am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/2 "2022-09-07T09:00:29Z")

</div>

@theshysnail ,

> **[Id Property](https://www.revitapidocs.com/2020/8da1bd1e-581b-1577-6a58-579e11e25f2f.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

you are looking for this node?

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

---

<div class="post-metadata">

**Author:** ![theshysnail](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/theshysnail/32/146653_2.png) [@theshysnail](https://forum.dynamobim.com/u/theshysnail)\
**Post date:** [September 7, 2022, 9:22am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/3 "2022-09-07T09:22:17Z")

</div>

Yeah, is it possible to do it with Revit API inside the Python Script?

---

<div class="post-metadata">

**Author:** ![newshunhk](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@newshunhk](https://forum.dynamobim.com/u/newshunhk)\
**Post date:** [September 7, 2022, 9:43am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/4 "2022-09-07T09:43:43Z")

</div>

here you are:

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

---

<div class="post-metadata">

**Author:** ![chuongmep](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chuongmep/32/197537_2.png) [@chuongmep](https://forum.dynamobim.com/u/chuongmep)\
**Post date:** [September 7, 2022, 9:46am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/5 "2022-09-07T09:46:56Z")

</div>

**[BuiltInParameter](https://www.revitapidocs.com/2020/fb011c91-be7e-f737-28c7-3f1e1917a0e0.htm)** is Enum type , please input parameter of element,  
[CreateEqualsRule](https://www.revitapidocs.com/2020/2a4943e9-4efe-7b79-b1ea-8b85c253001d.htm) request input to parameter of element not **[BuiltInParameter](https://www.revitapidocs.com/2020/fb011c91-be7e-f737-28c7-3f1e1917a0e0.htm)**

Sample like this :

```nohighlight
pra = element.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS)
praid = pra.Id
filterRule = ParameterFilterRuleFactory.CreateEqualsRule(praid , "Hello", True)

```

---

<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 7, 2022, 10:02am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/6 "2022-09-07T10:02:10Z")

</div>

@chuongmep ,

yeah that works

```auto

element = UnwrapElement(IN[0])

pra = element.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS)
praid = pra.Id
filterRule = ParameterFilterRuleFactory.CreateEqualsRule(praid , "Hello", True)

OUT = praid

```

---

<div class="post-metadata">

**Author:** ![theshysnail](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/theshysnail/32/146653_2.png) [@theshysnail](https://forum.dynamobim.com/u/theshysnail)\
**Post date:** [September 7, 2022, 10:16am UTC](https://forum.dynamobim.com/t/get-id-of-parameter/80752/7 "2022-09-07T10:16:21Z")

</div>

Thanks. So you need an element to act as a placeholder to get the parameter? Then as in the image below, I can get all elements, irrespective of category, which follows the filter.

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

```auto
element = UnwrapElement(IN[0])
para = element.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS)

filterRule = ParameterFilterRuleFactory.CreateEqualsRule(para.Id, "Hello", True)
pFilter = ElementParameterFilter(filterRule)

elem = FilteredElementCollector(doc).WherePasses(pFilter).ToElements()

OUT = elem

```
