Get Element by Unique ID (GUID) rather than Element ID?

I have the below, which I am looking to change the Element by ID to something which uses the Unique ID (Guid) rather than the element ID. I have tried to use Chynamo ByIDString but dynamo just stays at not responding when I run. Any alternatives to be able to use the Unique ID rather than the Element ID?

It’d also be good to know if it is possible to use another field within the dataset to select which element

Hello @m.hoper9DMVY …could something work ?

3 Likes

Thanks for your help on this. How would I put this into my script? I don’t want to have to get the GUID from the element ID - as what I want my script to do overall is to import data from one excel file, and only import data relevant to the rooms with matching GUID’s, and I can’t do this with Element ID as they are not unique across multiple RVT Files.

I think you need to save the UniqueId in the excel-file with the rest of the Room data.
Then when importing, create a CodeBlock that says:
Revit.Elements.ElementsSelector.ByUniqueId (UniqueId, true)
So when the UniqueId from Excel matches with the Room’ s UniqueId, it will be selected.

1 Like

Appreciate the support. I have put that into place, but it still shows that the element could not be obtained? Any idea’s? I’ve done a check to ensure my Unique ID’s I had in my excel file are correct.

Have you noticed these are all the same?
Can you check pls?
image

1 Like

Hello are your sure the element from that guid exist in the model ? i see you try to get over 8000 elements and as far i can see in your image looks like the guid is the same…try only a few and see it will work

They are all unique - I’m going to try from a small list and see if it works
image

1 Like

After reducing the excel-file to just the UniqueID’s which exist within the Model, that now works. How do I now edit it, so it can work off that larger data set, and ignore the UniqueID’s which don’t exist in the model?

1 Like

Havent try but when the elemnt doesnt exist it should give a null in the list and give the good ones

1 Like

Hi - I’ve just picked up this piece of work again - Any idea why my list clean, is removing the nulls, but then replicating the remaining values into a sublist?

Hi try to get rid of these nulls…they are there probably because you have unplaced and unbounded rooms,

Hi - The blanks are there due to the schedule having data for multiple models - how do I remove nulls from list within dynamo? Thanks!

Hi @m.hoper9DMVY Im not really sure whats goin here, but i see you feed in 8202 elements…if you want then share a little snip of your dataset…and i will take look

Many thanks for this - I’ve attached the data set and current dynamo file.

In context - We have over 300 Revit Models, and I’d like to use Dynamo to import data based off the GUID from one large data set (Element ID isn’t unique across all of the Models)
Data for Equip_ID import.xlsx (235.0 KB)

ImportEquipID_Save.dyn (52.6 KB)

arghh 300 rvt models…could you share a little piece of one of them as well just a little piece where the issue will be…

Hi - I have sent you a message on here so I can share RVT File. Thanks!

Hi Matt yeah i saw it where you ask about my email…its better you share over fileshare,dropbox etc. and just insert the link here, or if it secret you are welcome to insert the link in a pm to me here…thanks

1 Like