Are UniqueIDs guaranteed to be the same after upgrading

Are UniqueIDs guaranteed to be the same after upgrading

RPTHOMAS108
Mentor Mentor
400 Views
3 Replies
Message 1 of 4

Are UniqueIDs guaranteed to be the same after upgrading

RPTHOMAS108
Mentor
Mentor

Are UniqueIDs guaranteed to be the same after upgrading a work-shared file from one version of Revit to another?

 

I'm using them as an external key, I want to use new features of the RevitAPI and transform the results back into parameters of the older Revit model we are using due to project constraints.

 

I'm hoping the answer to this yes/no question is yes.

 

 

0 Likes
Accepted solutions (1)
401 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Afaik:

 

Yes.

 

Please refer to this discussion for comprehensive, extensive, exhaustive, all-encompassing information:

 

http://thebuildingcoder.typepad.com/blog/2015/02/understanding-the-use-of-the-uniqueid.html

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 4

RPTHOMAS108
Mentor
Mentor

Hello Jeremy,

 

Thanks for the reply.

 

I often get a lot of answers from your blog, it is a very good source of information. I think I read that link at the time but re-reading it now I interpret the line with the ‘serious roadblock’ comment as something that means there is not certain to be 100% consistency between the UIDs in an original model file and the UIDs in the upgraded model file.

 

I was envisaging the situation where new features of Revit would call for existing elements to be converted to new types which may lead to the regeneration of UniqueIDs in some instances. So, I was looking for the inner knowledge where they either say:

 

“Yes, when updating the database structure between versions we are careful to ensure the UniqueIDs remain the same.”

Or

“No, we can’t guarantee UniqueIDs remain the same after upgrade as this may need to change due to changes in the UniqueID system itself.”

 

Thinking about it some more we could easily find out by extracting all UniqueIDs before and after upgrade to see if they match up. If we have 100 UIDs from the old model and 150 UIDs from new model we could see if 100 UIDs are common to both (assuming different new elements would not be given UIDs from the old existing set).

 

Regards

 

Richard

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

Dear Richard,

 

Thank you for your appreciation and clarification.

 

Yes, I see and understand what you are after.

 

You address an interesting aspect here.

 

In a case like that, where a specific feature is of specific importance to you, I would recommend implementing a unit test for it, along the lines that you described.

 

As I'm sure you can appreciate, Revit and its API provides many thousands if not millions of similar bits of functionality.

 

Some are important to the factory itself, some to certain developers, and it is impossible to anticipate and implement unit test for every single thing.

 

A guarantee or even an expression of intent such as you are asking for is not worth much without a unit test to back it up, I think.

 

My assumption would be "yes, this is the general intention" combined with "no, it cannot be guaranteed 100%... something unexpected is sure to crop up sooner or later"... which seems to be more or less what you are expecting in raising the issue  🙂

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes