Navisworks API

Reply
New Member
PauliL
Posts: 1
Registered: ‎12-01-2011
Message 1 of 2 (119 Views)

ModelItem.InstanceHashCode

119 Views, 1 Replies
09-24-2012 02:24 AM

How stable InstanceHashCode is? It seems that if open same file on different machine then it is changed.

 

Pauli

ADN Support Specialist
xiaodong.liang
Posts: 1,335
Registered: ‎06-12-2011
Message 2 of 2 (108 Views)

Re: ModelItem.InstanceHashCode

10-10-2012 03:36 AM in reply to: PauliL

Hi,

 

From our engineer team:

 

InstanceHashCode is not really stable, it is just a hash code. It will only really be stable for the lifetime of the .NET object. You should only really use it for things such as inserting the object into a dictionary, etc…

 

The InstanceGuid is a better stable ID. Some files might not contain GUIDs though (it depends on the source of the file), although they might contain some other form of stable ID (such as Element ID or Entity Handle). And for some formats, it’s almost impossible to work out a stable ID in the first place.

 

Hope this helps.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.