Can we count on Shape ID stability?

Started by Visisthebest, September 20, 2020, 11:01:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

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.
Visio 2021 Professional

Paul Herber

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 for Visio -

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

vojo

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

Thank you Paul and vojo very good to understand this better!
Visio 2021 Professional