unique ID for project

unique ID for project

phildebrandt
Enthusiast Enthusiast
4,650 Views
6 Replies
Message 1 of 7

unique ID for project

phildebrandt
Enthusiast
Enthusiast

Does anyone know if there is a unique ID number for projects stored in the Revit file?

 

I found one in the ProjectInfo.uid (see code snippit below)

 

            Autodesk.Revit.DB.Document actdoc = this.ActiveUIDocument.Document;
ProjectInfo pi = actdoc.ProjectInformation;
pid = pi.UniqueId;

 

 

However, this is the UID of the ProjectInfo object, it can be the same in 2 different Revit files.

 

I'm trying to find a UID that is the same for the local and central files of the same project but different between seperate projects.

 

Anyone know if one exists?

0 Likes
4,651 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

Hi,

 

This is almost the same question discussed here -> http://forums.autodesk.com/t5/Autodesk-Revit-API/How-do-you-access-a-model-s-GUID-or-UniqueId-using-...

 

I know this is an old post but I was facing the same issue and I found something that may help you. This works for Revit 2013.

 

UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
string ifcproject = ExporterIFCUtils.CreateProjectLevelGUID(doc, Autodesk.Revit.DB.IFC.IFCProjectLevelGUIDType.Project);

 

This is the website were I found the info

 

http://matteocominetti.com/revit-api-2013-ifcproject-guid-in-c/

http://matteocominetti.com/revit-api-2013-get-uniqueid-from-ifcguid-and-from-guid/

 

Marc

Message 3 of 7

Anonymous
Not applicable

hi, 

Did you find  solution for your problem, I'm facing the same issue right now

 

🙂

0 Likes
Message 4 of 7

jeremytammik
Autodesk
Autodesk

I once created a dedicated add-in to address this issue:

 

http://thebuildingcoder.typepad.com/blog/2016/04/named-guid-storage-for-project-identification.html

 

Cheers,

 

Jeremy



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

Message 5 of 7

Anonymous
Not applicable

Thank you Jeremy, I have implemented that, and  I will let you know about the result :).

0 Likes
Message 6 of 7

mizrachi_amir
Contributor
Contributor

Hi,

 

Fast forward 7 years, anything new with that?

0 Likes
Message 7 of 7

jeremy_tammik
Alumni
Alumni

Nope, sorry, no news on this front. You might want to have a look and see whether there is a wish list item for this functionality in the Revit Idea Station and vote for that...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes