# Id to element, by excel

**URL:** <https://forum.dynamobim.com/t/id-to-element-by-excel/5053>\
**Category:** Revit\
**Created:** [July 15, 2016, 7:43pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053 "2016-07-15T19:43:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 15, 2016, 7:43pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/1 "2016-07-15T19:43:08Z")

</div>

Hi

I wonder how we could convert a list of id from excel and select the elements in Dynamo.  
I’ve tried every node of “id to element” type, and it doesnt work at all.  
I also try to change the list to number, but it is alreade a number.

If i use codeblck and type manually every id number, it works…

Is there a better way?

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [July 15, 2016, 8:35pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/2 "2016-07-15T20:35:39Z")

</div>

Please show some work, sample images of warnings, sample files (excel, dynamo etc).

---

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 15, 2016, 10:47pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/3 "2016-07-15T22:47:46Z")

</div>

Hi Konrad,

here an example, but this time i use flux for the input Id(s).  
As you can see, i even type in codeblock a number (and those numbers exist in the project.)

if i plugged a list of ID directly from a Dynamo selection, it works. but if its from Excel or Flux, none of the nodes are working.

thank you for your time.

Best

Ps: by the way, great tutorial on ThinkParametric.

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

---

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 15, 2016, 10:49pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/4 "2016-07-15T22:49:45Z")

</div>

sorry, the PNG was unreadable.

here another one.

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

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [July 15, 2016, 11:23pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/5 "2016-07-15T23:23:42Z")

</div>

Try typing the following in a codeblock:  
ElementSelector.ByUniqueId(id, true);

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [July 15, 2016, 11:27pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/6 "2016-07-15T23:27:43Z")

</div>

Well, that’s a really long list of IDs. I bet there is at least one in that list that is no longer valid and its killing the whole party for you. Try what @salvatoredragotta suggested and let’s see what happens.

---

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 16, 2016, 2:15am UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/7 "2016-07-16T02:15:24Z")

</div>

!! you were right!  
it has 1 different id on more than 480… that is strange because id suppose to be permanent isn’t?

i tried typing ElementSelector.ByUniqueId(id, true); , but it gave me a null result.

so from wat i understand, if only one id in the list are NOT in the project, the node broke.

thank you guys for the answers!

Best

Y

---

<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:** [July 16, 2016, 4:54am UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/8 "2016-07-16T04:54:34Z")

</div>

Hi Yien,

Its working from my side. I have tested for 55589 elements. Make sure you convert excel values to “System.Int32” Type.

try this:

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/155201f8bf8f903d4e54ca9ec63063c42c8dc349.png)

---

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 16, 2016, 5:03am UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/9 "2016-07-16T05:03:40Z")

</div>

Kulkul

This Is a nice approach and could solve orphan id.  
But why convert to number and then to string?  
Thought they were only thoses types of parameters : integer, double, boolean and string.

I’ll give it a try and let you know.

Thank you!

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 16, 2016, 5:42am UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/10 "2016-07-16T05:42:13Z")

</div>

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/5/518bc0ae0988e577afc80b1a5ba6e104ed1bd030.png)

---

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 16, 2016, 3:02pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/11 "2016-07-16T15:02:42Z")

</div>

ok guys here the result…

1. have to remove the missing id
2. and then make sure the object type is an system.int32 (number from excel and flux are DOUBLE).

Vikram, Kulkul, Konrad, Salvator… thank you so much!

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/7/762e62b839fe49ff336b092ff00d33173ee81099.png)

---

<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:** [July 16, 2016, 3:21pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/12 "2016-07-16T15:21:30Z")

</div>

@Yien Can you mark the post as solved. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Yien](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@Yien](https://forum.dynamobim.com/u/Yien)\
**Post date:** [July 16, 2016, 4:12pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/13 "2016-07-16T16:12:19Z")

</div>

would like to…but cant event find th “solved” mark.  
time to take a rest i think.  
😐

---

<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:** [July 16, 2016, 5:08pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/14 "2016-07-16T17:08:53Z")

</div>

At the bottom you will find.  
 ![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/1/12a881382571aa2c4b8d57492e232070876a3e9a.png)

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [July 16, 2016, 9:54pm UTC](https://forum.dynamobim.com/t/id-to-element-by-excel/5053/15 "2016-07-16T21:54:58Z")

</div>

@Yien,

To answer your question about the “permanency” of Element Ids. They are NOT supposed to be permanent. The idea is that Element Id of an Element in a WORKSHARED Revit model can change at any time during its life. To make a long story short the id can be reassigned when different people edit the element and then synch to Central model. Please see this post for more info: [http://thebuildingcoder.typepad.com/blog/2015/02/understanding-the-use-of-the-uniqueid.html](http://thebuildingcoder.typepad.com/blog/2015/02/understanding-the-use-of-the-uniqueid.html)

Next time just use the UniqueId property, also commonly known as Guid. Those NEVER change.

Cheers!
