Author Topic: Can we count on Shape ID stability?  (Read 141 times)

0 Members and 1 Guest are viewing this topic.

Visisthebest

  • Full Member
  • ***
  • Posts: 163
Can we count on Shape ID stability?
« on: September 20, 2020, 06:01:12 AM »
Are there edge cases where the same shape on the same page will get a new Shape ID, maybe for instance there is some edge case when the user saves the file with the page over a period of weeks as new file versions, or his/her laptop crashes and he/she uses office file recovery to save the recovered file and continues working on it. Or any other edge case.

Of course if a user deletes then creates new shapes those new shapes may get the deleted shape’s ID. The core question is: other than this specific scenario of shape deletion (or programmatic/otherwise intended explicit changing of the shape ID), is it virtually impossible for a Shape’s ID on the same page to change?

We can use the UniqueID as well of course, but still important to understand how ‘stable’ Shape ID on the same page is.
« Last Edit: September 20, 2020, 06:26:31 AM by Visisthebest »

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2947
    • Paul Herber's website
Re: Can we count on Shape ID stability?
« Reply #1 on: September 20, 2020, 11:03:30 AM »
As far as I know once an ID has been issued to a shape then it is never reused, even after that shape has been deleted. The only case I can see where an ID gets reused is where a shape is deleted, then that action is undone. That restores the shape(s) with the same ID(s).
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

vojo

  • Hero Member
  • *****
  • Posts: 1521
Re: Can we count on Shape ID stability?
« Reply #2 on: September 20, 2020, 04:22:19 PM »
I guess that bug got fixed along the way.   At least at 2003, the shape ID could be reused. though I have never seen it.
There are words around SETF and GETREF about this

Essentially, the formulas
SETF(GETREF(<some cell in some shape>), <value or formula resulting in a value to go in that cell>)
and
SETF(<some cell in some shape>, <value or forumal resulting in a value to go in that cell>)
are the same, except the GETREF enforces name resolution.

This must have been fixed in post 2003.

Visisthebest

  • Full Member
  • ***
  • Posts: 163
Re: Can we count on Shape ID stability?
« Reply #3 on: September 21, 2020, 05:12:27 AM »
Thank you Paul and vojo very good to understand this better!