How to uniquely identify a model item

How to uniquely identify a model item

Anonymous
Not applicable
2,180 Views
4 Replies
Message 1 of 5

How to uniquely identify a model item

Anonymous
Not applicable

Hey Forum,

 

In working with the Navisworks API, I noticed that not all of the ModelItems produced by the API have a Instance GUID. I've been told that the API should provide a Unique ID in some way to help perform change management of the models, but I'm just not seeing a Unique ID that's there regardless of the model software used to build the model.

 

Is there some place in the ModelItem the API produces where I can uniquely identify it in code?

0 Likes
2,181 Views
4 Replies
Replies (4)
Message 2 of 5

Aaron.Lu
Autodesk
Autodesk
Dear Ryan,
ModelItem.InstanceGuid should be related with the model from the source, if the source model did not have a GUID, then it should be null too. is it true?


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 5

Aaron.Lu
Autodesk
Autodesk
EDIT the answer again:

ModelItem.InstanceGuid is generated by Navisworks (and not all modelItems have this) and if you want to get guid of source model, you can go through the properties of the ModelItem, different products have different ways to get these ids.

a blog may help on this:
http://the360view.typepad.com/blog/2015/02/revit-uniqueid-in-glue-and-navisworks.html
this is for when you opening rvt file directly.

did you open the source file directly or open the exported nwc file?
if you open the exported nwc file, you need to check "convert revit properties" option when exporting the file.

and what is the format of the source file?


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 4 of 5

Aaron.Lu
Autodesk
Autodesk

Source id should be different for different products, e.g.

For AutoCAD, you can get this PropertyCategory (LcOpDwgEntityAttrib),
For Revit, get PropertyCategory (revit_element_properties) and then DataProperty "UniqueId" from PropertyCategory.Properties.



Aaron Lu
Developer Technical Services
Autodesk Developer Network
Message 5 of 5

Wolfgang.B.Weh
Enthusiast
Enthusiast

The information in this blog is still correct and up-to-date as far as I know:

 

See also the following questions:

 

You could store your own GUID with those model items you are interested in, for example as custom properties.

 

Hope this helps

 

Wolfgang