Glue API Samples Updated
Happy Valentine's Day!

Revit UniqueId in Glue and Navisworks

Every Revit element has a property called UniqueId. As the name suggests, it’s an unique identifier of an element in Revit. At glance, it looks like GUID. But it actually has additional eight (8) characters at the end. It was added for API users in order to uniquely identify each element. Other properties, for example, Element ID, is not guarantied to be unique. DWF and IFC use GUID. But as stated above, they differ from UniqueId. UniqueId is accessible only by API. (Jeremy Tammik describes this topic in detail on his blog.) 

Being able to identify each element by UniqueId is important for many API users in order to link external information to a specific element. For example, to realize a round trip between Revit model and an analysis program, you may use UniqueId to identify the existing elements.  

How can I access Revit UniqueId in Glue?” is one of questions I get occasionally. It wasn't possible originally. With the enhancement with Navisworks exporter, it is possible to include it and view in Glue properties dialog. (Make sure you install the latest version of 2015 exporter and above.) But it may not be so obvious as UniqueId is not included by default when importing/exporting to a Navisworks file.

Revit to Glue

To include UniqueId in Glue viewer, you will need to specify it in the Navisworks exporter options. From Revit, go to Export to Navisworks command (either from External Tools or big "R" >> Export >> NWC). In [Export scene as … ] dialog, click on [Navisworks settings…]. In the [Navisworks Options Editor – Revit] dialog, check mark [Convert element properties]. 

Navisworks Options Revit2

This includes UniqueId as a part of exported NWC file. Once you upload this exported NWC file, you will see property category called “Element Properties”. Under this category, you will see UniqueuId. 

UniqueId in Glue2


Via Navisworks

Another route is from Navisworks. UniqueId will be included by setting [Covert element properties] turned on. From big "N" >> [Options] >> [File Readers] >> [Revit] >> check mark [Cover element properties].  

Navisworks Options Revit Navisworks2

With this setting, open or reload a Revit file. Once loaded, check the properties. You will see UniqueId under [Element Properties] tab:]. You can use GlueIt addin command to upload Revit files.



Accessing through API

Now that we see UniqueId in the Glue’s element properties, I tested using Lab4 Glue API Web Intro JS sample to see if we can access it from the selected element. The result is - it is possible. A sample image is shown below. 

UniqueId in Lab4

Note: while accessing properties of a selected element has many use cases of application, you may also question if we can search entire model using an UniqueID. Unfortunately, it is not possible at a moment. This will be another enhancement wish.