0

We are looking for a way to distinguish between Revit models from multiple different computers. For BIM360 and Revit Server models, we are able to use

document.GetWorksharingCentralModelPath().GetModelGUID()

However, for local models and central models, we are not able to grab any sort of unique identifier for the model. We cannot set a parameter with a GUID due to the fact that multiple users start from a template Revit model, therefore copying the unique identifier and making them non-unique. Is there any way to uniquely distinguish a Revit model using the Revit API?

  • perhaps a combination of username and central path? I don't know of any special identifier, but a model will have local path that is specific to user, and central path that should be shared. – konrad Mar 24 '18 at 00:17

2 Answers2

1

The Building Coder discussed the issue of creating your own unique project id and using Named Guid Storage for Project Identification.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Thanks for your response. The GUID returns great, but unfortunately if I copy that *.rvt file from one location to another, the GUID follows the copied project. – Jacob Scheib Mar 28 '18 at 16:25
  • yes, of course. if that bothers you, you will have to implement something that ensures that the name and location and whatever of the project file remains untouched and intact in whatever manner you care about, and issues a warning and creates a new GUID whenever that is not the case. how about using the OS to ensure that it becomes impossible to copy files at all? :-) – Jeremy Tammik Mar 29 '18 at 17:40
0

in my opinion, copying the Revit Document should NOT result in a new ProjectId.

Additionally, These members don't deliver good results:

Document.ProjectInformation.Id
Document.ProjectInformation.UniqueId

The soultion above proposed by The Building Coder will work, if you want to program some kind of uploader. You will then create a GUID and save it in the "invisible storage" called ExtensibleStorage, that only your program can read again.

The easiest apporach is:

ExportUtils.GetGBXMLDocumentId(Document);
Matters
  • 1
  • 1
  • Is `ExportUtils.GetGBXMLDocumentId` stable? What's is its purpose and are there any reasons not to use it as a unique document ID? – bartzy Feb 02 '20 at 15:27