Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unique Id changing

5 REPLIES 5
Reply
Message 1 of 6
chris.j.mckeown
1305 Views, 5 Replies

Unique Id changing

Hello,

 

Does a unique ID every change? I want to say yes, during syncronization on a workseted file?

 

If this is true is there a way of catching the old unique ID and the new unique ID?

 

Regards

 

Chris Mckeown

5 REPLIES 5
Message 2 of 6

UniqueId does not change; you can rely on it even in work-shared files between synchronizations.

However, it is possible, naturally, that the element with a certain UniqueId is no longer available after synhronizing with the central model.

Arnošt Löbel
Message 3 of 6

Hi Arnošt,

 

Thank you for the prompt reply.

 

What do you mean "However, it is possible, naturally, that the element with a certain UniqueId is no longer available after synhronizing with the central model."?

 

I have been recording element id's within a workshared file, very little in this file is being deleted, mostly additions and modifications, however a couple of days have gone by of saving and synchronizing the file, and yesterday I went to compare the ids in the external database against those in Revit, only to find over 60% of the ids in the external database are not findable within Revit, again limited deletions are occurring in this file. The only conclusion is that the unique Id's, may change from that in the local file to the central file upon synchronization depending on the uniqueness of the id and to remove duplicated ids?

 

Regards

 

Chris Mckeown

Message 4 of 6
PhillipM
in reply to: chris.j.mckeown

Chris.

 

Are you talking about ElementID's or UniqueID which is a GUID?

 

Cheers

Phillip

Message 5 of 6
chris.j.mckeown
in reply to: PhillipM

Hi PhillipM,

 

Unique ID.

 

From http://thebuildingcoder.typepad.com/blog/2009/02/uniqueid-dwf-and-ifc-guid.html "Every element has such a unique identifier, which is returned through the API as a string. This string is formatted in groups of 8-4-4-4-12-8 hexadecimal characters. It is thus similar to the standard GUID format, but has 8 additional characters at the end. These 8 additional hexadecimal characters are large enough to store 4 bytes or a 32 bit number, which is exactly the size of a Revit element id."

 

I want to know if the unique id every changes during synch, i.e. if two users add a new element to their local files, can those unique id's be the same in the local files, and when both files are synch to the central is one of the 2 ids is modified to keep both truely unique in the central???

 

Regards

 

Chris Mckeown

Message 6 of 6

Hello Chris,

The answer is no, the unique IDs will not be modified upon syncing. There are indeed unique in those files. If two users create two elements each in their respective local files, then after they both sync to the central there will be four elements in total, each of them having its unique Id.

Now, your claim about changed unique Ids made me curious and I realized that I might be short on details here. (I am no work-sharing expert). So, I do not actually know if the unique Ids that are assigned in local files (when elements are created there) are the exactly same unique Ids that you can find for the same elements in the central file after you sync. However, what I know is that if you try to look up your element with the Unique Id you acquired when created the element, you should get the same element regardless of whether the unique Id was altered by syncing (only the last 8 codes of the Id would be altered, since that contains the element's work-sharing history (at least that is what I believe)). Does that make sense?

I can try to find more details from true experts next week.
Arnošt Löbel

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community