Persistent ID's in API

Discussion in 'SolidWorks' started by heyheyjc, Jun 12, 2007.

  1. heyheyjc

    heyheyjc Guest

    Anyone know the most appropriate way to use the persistent ID's to re-
    find a component, entity or mate when re-loading saved data into an
    add-in? The problem is that the add-in may not be active when the
    model is loaded, and the "persistent" ID's are not conserved across
    rebuilds, so may be useless by the time the add-in gets to see them. I
    have to match up my own data with particular components etc.

    Thanks in advance,
    JC
     
    heyheyjc, Jun 12, 2007
    #1
  2. heyheyjc

    Heikki Leivo Guest

    Anyone know the most appropriate way to use the persistent ID's to re-
    Do you mean the persistent ID's returnet by
    ModelDocExtension.GetPersistReference3 method, or something else? Those
    references are persistent across rebuilds and whatever (since otherwise they
    would not be... persistent!). I use the persistent references in my
    application and they work just great I.M.O.

    -h-
     
    Heikki Leivo, Jun 12, 2007
    #2
  3. heyheyjc

    Heikki Leivo Guest

    Do you mean the persistent ID's returnet by
    .... Or do you really mean that the persistent references may change somehow?
    Why and when? If it is true, I am quite shocked, since that does not sound
    quite persistent to me.

    The persistent reference API is I.M.H.O one of the most useful API's ever
    exposed, but if the references are not persistent it is just ridiculously
    unuseful... I use the PRef API to store and restore selected entities, and
    if it fails, my product will not quite work and in the long run my customers
    will simply kill me if they lose data and/or productivity. It has worked so
    far in my case, fortunately. Gotta keep my eyes open...

    Interesting scenario, indeed.

    -h-
     
    Heikki Leivo, Jun 12, 2007
    #3
  4. heyheyjc

    heyheyjc Guest

    Thanks for that. I'm running 2005 and even the API-Help disclaims
    their persistence past rebuilds; I've certainly seen inconsistencies.
    Hopefully it's changed, if you are running more up to date, but I
    would still have liked my app to work well on '05. What's your app?
    Does it need to re-find Mates and Components, as well as entities?

    JC
     
    heyheyjc, Jun 13, 2007
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.