Copying a Visio page with shapes, do the shapes retain their ID's?

Started by Visisthebest, July 15, 2021, 01:24:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

When you copy a Visio page (with the duplicate function when you right-click a page), do Visio shapes always keep the same ID's as on the original page?

The Unique ID's get erased which makes sense, as these should be globally unique.
Visio 2021 Professional

wapperdude

This is quick test, why not try it?

As I recall...maybe yes, maybe no.  Each page starts with new set ID's.  If the shapes get copied in sequential order, then there would be no correlation.  There might still be random cases where the shapes on both pages have same ID.  Also, consider shapes deleted on original page.  There could be gaps.  New page, I believe, has no gaps.

...so, maybe yes, maybe no.  Alternatively, if you need it to be, it won't, but if you don't want it to be, it will.  To be or not to be...
Visio 2019 Pro

Paul Herber

Doing the page copy via the (Visio 2016) ribbon Insert -> Pages -> Duplicate this Page
the shape IDs seem to duplicate correctly.
Electronic and Electrical engineering, business and software stencils for Visio -

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

Visisthebest

Thank you go to know how Visio behaves with page duplications and Shape IDs!
Visio 2021 Professional

Paul Herber

It's a guess, it's what it does in that instance, under those circumstances. MS may change it.
See Wapperdude's post. Possibly maybe perhaps.
Electronic and Electrical engineering, business and software stencils for Visio -

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

wapperdude

This was such a simple test, takes longer to ask question and receive answer and weed thru what's true or not.

Back at my computer, took less than 5 minutes to create test cases.  Whether you duplicate as Paul indicates or right click on page tab and select Duplicate, results were identical.

Placed 10 shapes on 1st page.  Duplicated.  ID's were preserved.  (Each shape displays its ID.)
Note, the 10 shapes were dispersed randomly, so there was no logical orderr to their placement.  Thus, duplication was not based upon some sort of scanning algorithm.

Next, deleted at random a couple shapes, then duplicated the page.  Order and IDs were still preserved, including ID sequence gaps.  Selected and duplicated a shape before any gaps; it's assigned ID was the next at the END of the full sequence.  So, reusing/gap filling is not done either. 

Barring a change by M$, this is how things are as of V2019 desktop.
Visio 2019 Pro