Visio Guy

Visio Discussions => General Visio => Topic started by: Visisthebest on July 15, 2021, 01:24:47 PM

Title: Copying a Visio page with shapes, do the shapes retain their ID's?
Post by: Visisthebest on July 15, 2021, 01:24:47 PM
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.
Title: Re: Copying a Visio page with shapes, do the shapes retain their ID's?
Post by: wapperdude on July 15, 2021, 03:42:23 PM
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...
Title: Re: Copying a Visio page with shapes, do the shapes retain their ID's?
Post by: Paul Herber on July 15, 2021, 04:06:28 PM
Doing the page copy via the (Visio 2016) ribbon Insert -> Pages -> Duplicate this Page
the shape IDs seem to duplicate correctly.
Title: Re: Copying a Visio page with shapes, do the shapes retain their ID's?
Post by: Visisthebest on July 15, 2021, 05:10:54 PM
Thank you go to know how Visio behaves with page duplications and Shape IDs!
Title: Re: Copying a Visio page with shapes, do the shapes retain their ID's?
Post by: Paul Herber on July 15, 2021, 05:16:17 PM
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.
Title: Re: Copying a Visio page with shapes, do the shapes retain their ID's?
Post by: wapperdude on July 15, 2021, 05:28:15 PM
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.