Id to element, by excel

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?

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

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.

sorry, the PNG was unreadable.

here another one.

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

1 Like

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.

1 Like

!! 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

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:

2 Likes

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!

2 Likes

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!

@Yien Can you mark the post as solved. Thanks :slight_smile:

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

At the bottom you will find.

2 Likes

@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

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

Cheers!

4 Likes