# Selected element by id returns null value

**URL:** <https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664>\
**Category:** Packages\
**Tags:** clockwork, package\
**Created:** [November 20, 2017, 3:35pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664 "2017-11-20T15:35:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmora1990](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pmora1990/32/32367_2.png) [@pmora1990](https://forum.dynamobim.com/u/pmora1990)\
**Post date:** [November 20, 2017, 3:35pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/1 "2017-11-20T15:35:30Z")

</div>

I’ve used the Clockwork package node called **Element.ByID**. However, when I input a number with the code block it returns a **null** value as output. This is weird because I know the element exists inside the Revit model because it appears on a warning window. (Yes, I have an element warning and I’m trying to identify the element using Dynamo) Here are some images that explain my situation:

 ![aaaaa33333333](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/f/6f51274bd51aa1459d43cb34e2059fed47776662.jpg)

---

<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 20, 2017, 3:49pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/2 "2017-11-20T15:49:18Z")

</div>

Are you able to select the element by Id in Revit?  
Can you open up the custom node and make sure nothing is missing or erroring in there?

---

<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:** [November 20, 2017, 5:13pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/3 "2017-11-20T17:13:35Z")

</div>

Hi @pmora1990

Try internal selection method.

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

---

<div class="post-metadata">

**Author:** ![pmora1990](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pmora1990/32/32367_2.png) [@pmora1990](https://forum.dynamobim.com/u/pmora1990)\
**Post date:** [November 23, 2017, 2:16pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/4 "2017-11-23T14:16:57Z")

</div>

Hi Kulkul,

That worked, thanks! I’ve never used coding before in Dynamo. What programming language is that you’re using and where can I find more information or tutorials about how to use it on my projects?

---

<div class="post-metadata">

**Author:** ![pmora1990](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pmora1990/32/32367_2.png) [@pmora1990](https://forum.dynamobim.com/u/pmora1990)\
**Post date:** [November 23, 2017, 2:18pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/5 "2017-11-23T14:18:08Z")

</div>

Hi @Nick_Boyts ,

I tried using the built in funtion in Revit and it worked, however Dynam proved much faster and versatile. I suggest you check the workflow that @Kulkul proposed. THanks!

---

<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:** [November 23, 2017, 2:45pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/6 "2017-11-23T14:45:25Z")

</div>

> [@pmora1990](#):
>
> What programming language is that you’re using and where can I find more information or tutorials about how to use it on my projects?

I’m using DesignScript to call revit internal selection method. You can find more about designscript here.

[https://www.revitforum.org/dynamo-bim/27485-introduction-designscript.html](https://www.revitforum.org/dynamo-bim/27485-introduction-designscript.html)

> [@Dynamo DesignScript Learning Resources](https://forum.dynamobim.com/t/dynamo-designscript-learning-resources/6359):
>
> Since the question keeps appearing on the forum I thought I would create a dedicated topic so its easily searchable. DesignScript is Dynamo’s native scripting language and is similar to C# and Python. I would recommend any Dynamo user to learn the basics as it can significantly enhance proficiency. Here are some great resources for those interested in learning: A basic overview of DesignScript: [http://dynamobim.org/wp-content/links/DesignScriptGuide.pdf](http://dynamobim.org/wp-content/links/DesignScriptGuide.pdf) Detailed DesignScript documentation: …

[http://dynamoprimer.com/en/07\_Code-Block/7-2\_Design-Script-syntax.html](http://dynamoprimer.com/en/07_Code-Block/7-2_Design-Script-syntax.html)

Please mark the post as solved. You’re welcome!

---

<div class="post-metadata">

**Author:** ![Andreas\_Dieckmann](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andreas_dieckmann/32/365_2.png) [@Andreas\_Dieckmann](https://forum.dynamobim.com/u/Andreas_Dieckmann)\
**Post date:** [November 23, 2017, 3:51pm UTC](https://forum.dynamobim.com/t/selected-element-by-id-returns-null-value/16664/7 "2017-11-23T15:51:04Z")

</div>

@pmora1990 Since you are using an older version of Clockwork, I’d be interested to see if the node works on your end once you upgrade to the current Clockwork version.
