Visio Guy

Visio Discussions => Programming & Code => Topic started by: OldSchool1948 on October 26, 2017, 08:20:45 PM

Title: Getting Shape Data for Connected Shapes
Post by: OldSchool1948 on October 26, 2017, 08:20:45 PM
I need to cycle through each connector on a page and extract Shape Data from an individual shape or shapes in a container.  Extracting the Shape Data is a piece of cake  :).

I can identify the connected shapes:

Con ID        Con Text      Glued Shapes
489          4             Sheet.42 - 0 > Sheet.222 - 0
235          18            Container.319 - 4 > Cloud App Server Sngl.324
10           13            Sheet.58 - 0 > Sheet.222 - 0
11           7             Availability Group - 1 > Cloud App Server Sngl.289
12           8             Container.272 - 3 > Cloud App Server Sngl.278
13           6             Container.272 - 7 > Availability Group - 0


Is there a way to use a connector's 1-D Endpoints info to get a their respective glued shape's IDs, or is there some other way to achieve the same end?

Thanks for any advice.
Title: Re: Getting Shape Data for Connected Shapes
Post by: wapperdude on October 26, 2017, 08:36:14 PM
See the following:
  https://msdn.microsoft.com/en-us/vba/visio-vba/articles/shape-connectedshapes-method-visio (https://msdn.microsoft.com/en-us/vba/visio-vba/articles/shape-connectedshapes-method-visio)
  https://social.technet.microsoft.com/Forums/office/en-US/7421102b-e7c6-413d-87fe-a523de580d0b/sample-code-shapesconnectedshapes?forum=visiogeneral (https://social.technet.microsoft.com/Forums/office/en-US/7421102b-e7c6-413d-87fe-a523de580d0b/sample-code-shapesconnectedshapes?forum=visiogeneral)

The 2nd entry has more discussion to go with it.

Wapperdude
Title: Re: Getting Shape Data for Connected Shapes
Post by: OldSchool1948 on October 26, 2017, 08:57:51 PM
My diagrams can have one or more connections to individual shapes and containers.  Since it's so easy to get the connects collections, I figured that would be the way to. 

Thanks.  I'll look at ConnectedShapes again. 
Title: Re: Getting Shape Data for Connected Shapes
Post by: OldSchool1948 on November 15, 2017, 02:07:54 PM
wapperdude,

Just wanted to say thanks for pointing me in the right direction.  Got everything working like clockwork :D
Title: Re: Getting Shape Data for Connected Shapes
Post by: wapperdude on November 15, 2017, 03:29:59 PM
 ;)  You're most welcome.  Glad you were able to sort it out.  Nice.

Wapperdude