News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

How to find all subsequently connected shapes for a given shape?

Started by rsrikanth83, November 22, 2023, 02:29:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rsrikanth83

Hi all,
Kindly help with the below query, with a suggestion as low code as possible. All I can do is copy/paste VBA code into a new module and run it.

How to find all subsequently connected shapes for a given shape?

Context:
1. We have been given visio flows by the client, which need to undergo a lot of changes
2. Trying to mimic Excel Cross functional template, by linking each shape to external data
3. Then will export to shapesheet
4. From shapesheet, will copy to Excel Cross functional template, so that I can export the template into visio

Facing a challenge when doing the above steps:
For a given shape, trying to identify all subsequently connected shapes. The above steps is not giving this info, so I am getting slowed in step 4.

Your inputs/help will be much appreciated.

Thank you,
Srikanth.

wapperdude

Some questions:

Why are you taking the Visio file, loading it into Excel, and then transferring it back to Visio?  What is gained by doing this?

Your step 3:  is that going from Visio to Excel?  So, instead of shapesheet, which is unique Visio term, don't you mean worksheet, which is Excel term, for basically, a page in Excel document? Is this merely to change the visual nature of the diagram?

To get the connectivity, requires code.  The code could be used on either the original file, the modified file, or both for comparison.  If you get the connectivity from original file, is that sufficient...avoid redrawing that file?  Doesn't the conversion in step 3 provide the connectivity info?

Can you upload non-proprietary example of before and after?



Visio 2019 Pro

rsrikanth83

Hi,
Thank you for your inputs and your question as well.

(A) We have numerous current state process flows (client given visio) and we need to arrive at the future state process flows (we plan to use excel-Visio data visualizer to develop and continously update this)

Below are the steps I am following. (reason for the step in brackets)

Step 1 - [Visio] Add additional shape data to current state process flow - (this process flow will undergo lot of changes and we want to transition to a future state flow with excel-visio twin document through Data visualizer)
Step 2 - [Visio] Update Next Step ID, connector and other information (this is to get closer to the Excel Cross Functional Template for data visualizer)
Step 3 - [Visio ShapeSheet functionality] Export to Raw Excel (this is for the team to do further updates)
Step 4 - [Shapesheet Excel] Simplifly and take away unnecessary steps (to do further updates)
Step 5 - [Excel data visualizer template] Copy/paste only relevant process steps to Excel Template (this is to leverage the functionality considering we have to maintain a mountain of information for each process step)
Step 6 - [Into Visio] Import Excel Template into Visio (data visualizer template)
Step 7 - Add lot of process information to excel or Visio and make them co-existent (sustaining for the project timeframe)

Please comment if any of the steps are non-value adding

(B) Assuming I assign a unique number of all shapes and connectors (shape number). Kindly let me know if you can help with the VBA code to show all subsequent shapes for a given shape, through an excel based report.

-> looking for active visio page and I can create a new module and copy the VBA code and run.

Thank you!


wapperdude

I know what "subsequent" means, but am not sure how to interpret your intent.

The issue is, a shape may have either incoming or outgoing connectors attached to it.  Their directionality is determined by the beginning and end points.  Thus, subsequent seems to imply only outgoing connections from the shape.  However, if your drawing construction is such that flow proceeds left to right, and top to bottom, then, subsequent could mean only shapes that are either to the right or below the selected shape.  Those are 2 different cases.

Next issue, and perhaps this is just personal on my part, but it sounds like you desire someone to do part of your job.  If making your job successful requires learning to code, then, you should do that.  Learn it.  Among other things, it will enhance your value to the company.  As this site is supported by volunteers with regular jobs for the most part, then, their time is valuable.  If you need a consultant to do the task, then, offer some kind of payment.  For learning, most are happy to assist on an availability basis.

So, where to begin?
1) Visio actually puts the connectivity info in the connectors, not the shapes to which they're attached.
2) After choosing a starting shape, the code needs to loop through all connectors on the page, checking both ends to see if what it is attached to matches the selected shape.  This can be refined to either incoming or outgoing only.
3) Once a connector is found, then the opposite end has next shape.  That is, a new starting point and process repeats, until end of that flow path.
4) If more than one connector is attached to a starting shape, then, each must, in turn, be followed to paths end.
5) storing each connector and its connectivity is usually done using arrays, which can ultimately be interogated and results pushed into Excel or a List Box.

As you can see, such a task is not trivial.  There are a variety of connectivity report codes available, but I'm not aware of any that do explicitly what you need.  Have you explored Visio's data reports? 
Visio 2019 Pro

rsrikanth83

Yes I agree and see that the effort in question and subsequent development is a complex activity.

I explored some of the Visio reports - the simpler ones do not provide the info and the complex ones need ODBC data source, which I am trying not to deep dive into.

Overall talking to you made me think if I am bringing in some non-value adding steps. I am currently working to make the overall approach simpler.

Thank you for sharing your practical wisdom and I am happy to have joined this forum with people who are passionate about Visio!

Srikanth.

wapperdude

Perhaps if you could provide a simplified image that represents what you have and what you want to end up with, there might be some recommendations / alternatives that can be suggested.

The goal of subsequent connectivity is not unreasonable, it's just not simple.

BTW, another possible interpretation of subsequent, would be any/all shapes added after the selected shape, e.g., with ID's greater than the selected shape.  So, that part of the task still needs defining.
Visio 2019 Pro

wapperdude

I had forgotten about this development, http://visguy.com/vgforum/index.php?topic=8702.msg38020#msg38020.  It doesn't do subsequent, but you can select a shape and it will find and highlight everything connected to it.

It may give you an idea of what can be done.
Visio 2019 Pro

rsrikanth83


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 269 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1126KB.
Tokens: post-login.
Cache hits: 13: 0.00224s for 26,722 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]