# Get list project Parameter (the "ID", not the name)

**URL:** <https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286>\
**Category:** Revit\
**Tags:** clockwork, python\
**Created:** [November 7, 2017, 1:53pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286 "2017-11-07T13:53:31Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![clement.cazi](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@clement.cazi](https://forum.dynamobim.com/u/clement.cazi)\
**Post date:** [November 7, 2017, 1:53pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/1 "2017-11-07T13:53:31Z")

</div>

Hello,

I would like to find a way to get project parameter “Id”.

With Document.ProjectParameters (from clockwork), I have project parameters list but it’s a string list.

How can I custom this node to get the parameter “id”, and without selecting element ?

You can find with my capture what I’m looking when I get parameter from element.

Thanks,

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

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 7, 2017, 2:35pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/2 "2017-11-07T14:35:24Z")

</div>

Are you looking for the ElementId of the parameter or the element?  
You can modify the Clockwork node to return the Id as well as the name and category.

---

<div class="post-metadata">

**Author:** ![clement.cazi](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@clement.cazi](https://forum.dynamobim.com/u/clement.cazi)\
**Post date:** [November 7, 2017, 3:59pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/3 "2017-11-07T15:59:12Z")

</div>

I’am looking for the Id of the parameter, wich Element ID is an project parameter.

To get an other exemple, I’m looking for the Id of “Parameter\_crane”.

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

Why ? Because the node “FilterRule.ByeRuleType” wait a parameter.

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

The only way to get a parameter I found, is to have an element, and I don’t want to get parameter with element.

---

<div class="post-metadata">

**Author:** ![clement.cazi](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@clement.cazi](https://forum.dynamobim.com/u/clement.cazi)\
**Post date:** [November 7, 2017, 4:00pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/4 "2017-11-07T16:00:27Z")

</div>

@Nick_Boyts, I don’t have any experience with Python script ☹

---

<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:** [November 7, 2017, 4:35pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/5 "2017-11-07T16:35:51Z")

</div>

> [@clement.cazi](#):
>
> I don’t have any experience with Python script

You can still choose to use existing nodes or start to learn…

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 7, 2017, 4:37pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/6 "2017-11-07T16:37:57Z")

</div>

A good way to learn Python is to just look at other people’s code and try to modify it in small pieces to get what you want.

Here is the code from Document.ProjectParameters.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/e/6ed948dc0d8af6438dc2c757b1d7a0cd89d9a2cd.png)  
You can see in line 19 we take the Name of each Key and append it to the list we named `params`.  
You basically want to do this exact same process but with the Id instead of name. All you need to do is create a new empty list for our Ids after line 16.  
`ids = []`  
Then we can duplicate the line for getting names and change the pieces we need to instead append the Id to list `ids` that we just created.  
`ids.append(iterator.Key.Id)`  
Then just be sure to add our list `ids` to the output at the end of the code.

---

<div class="post-metadata">

**Author:** ![clement.cazi](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@clement.cazi](https://forum.dynamobim.com/u/clement.cazi)\
**Post date:** [November 7, 2017, 4:55pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/7 "2017-11-07T16:55:24Z")

</div>

I Tried to change the script but the node didn’t work.

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

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

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 7, 2017, 4:57pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/8 "2017-11-07T16:57:42Z")

</div>

“key” needs to be capitalized in line 21. You might also have to reload your graph before running.

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [November 7, 2017, 5:11pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/9 "2017-11-07T17:11:56Z")

</div>

I would take the Python script out of the custom node and insert it in its own Python script node, that way you can see what error you are getting when running the code:

 ![parameterid](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/0/50ac94b65183927717f77b97935481d060403a6b.png)

Side note… I think you may have to close out Dynamo and the Revit document, and reopen both.

@Nick_Boyts Maybe you could see if you can reproduce the same thing, but when I was playing around with this, if I ran the code with an error in it, neither the Clockwork **Document.ProjectParameters** node nor the edited Python code would work until closing and reopening both the Dynamo file and the Revit document. The Python code would return an error saying “The managed object is not valid” and the Clockwork node would return all nulls.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 7, 2017, 5:14pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/10 "2017-11-07T17:14:41Z")

</div>

I did have the same issue. I don’t know if there’s a way to force that method to reevaluate besides closing the Revit project unfortunately.

---

<div class="post-metadata">

**Author:** ![clement.cazi](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@clement.cazi](https://forum.dynamobim.com/u/clement.cazi)\
**Post date:** [November 7, 2017, 5:15pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/11 "2017-11-07T17:15:16Z")

</div>

Yes, I didn’t see the mistake.

The Id works.

Unfortunately, It was not what I’m looking for, sorry.

When I get the element with “Element.ById”, I got SharedParemeterElement, or ParameterElement, not “Element Id :”.

It’s maybe not possible to get the parameter without Element.

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

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [November 7, 2017, 5:24pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/12 "2017-11-07T17:24:44Z")

</div>

Using **Element.ByID** is giving you the parameter _element_ of the parameter “Element ID”, so you _are_ getting your parameter. Run the element through an **Element`.`Name** or a **Parameter`.`Name** node and you can see the name to verify. What is the error you are getting on the **FilterRule.ByRuleType** node?

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [November 7, 2017, 5:43pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/13 "2017-11-07T17:43:37Z")

</div>

Actually something in this isn’t working. Maybe something to do with how the **Element.ByID** node works, but the returned object type is an UnknownElement rather than a Parameter.

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

---

<div class="post-metadata">

**Author:** ![clement.cazi](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@clement.cazi](https://forum.dynamobim.com/u/clement.cazi)\
**Post date:** [November 7, 2017, 5:55pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/14 "2017-11-07T17:55:02Z")

</div>

I’m not sure but Filter rule by rule type wait a parameter.

The probleme is [parameter.id](http://parameter.id) give me an id, [parameter.name](http://parameter.name) give me a string, not the parameter.

---

<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:** [November 7, 2017, 6:37pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/15 "2017-11-07T18:37:54Z")

</div>

If you want the parameter object itself, this simple line should give it:  
`defs.append(iterator.Key)`  
Think also to check that your packages are up-to-date…  
Additional info on this topic:  
[https://forums.autodesk.com/t5/revit-api-forum/reporting-on-project-parameter-definitions-need-guids/m-p/4684297](https://forums.autodesk.com/t5/revit-api-forum/reporting-on-project-parameter-definitions-need-guids/m-p/4684297)

---

<div class="post-metadata">

**Author:** ![ruben.romero](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ruben.romero/32/115842_2.png) [@ruben.romero](https://forum.dynamobim.com/u/ruben.romero)\
**Post date:** [September 11, 2021, 5:03pm UTC](https://forum.dynamobim.com/t/get-list-project-parameter-the-id-not-the-name/16286/16 "2021-09-11T17:03:54Z")

</div>

> [@Yna\_Db](#):
>
> If you want the parameter object itself, this simple line should give it:

how can I get the parameter entity itself by from the ID of it? for example builtinparameters/project parameters/global parameters. I want to ask properties of the parameters later with OOTB nodes
