• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Navisworks API

    Reply
    New Member
    PauliL
    Posts: 1
    Registered: ‎12-01-2011

    ModelItem.InstanceHashCode

    57 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

    Please use plain text.
    ADN Support Specialist
    xiaodong.liang
    Posts: 813
    Registered: ‎06-12-2011

    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

    Please use plain text.