Glueing the right shapes together in a flowchart

Started by Hugh, November 05, 2008, 08:37:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hugh

Hi all,

I wrote some VBA code that reads an XML file and creates a flowchart based on it.  All the shapes are placed, and are glued together, I just can't work out the code for my next step.  I am sure that it is something fairly straightforward, and that it is something that has just not occured to me :-(
I have attached the outputted visio file to this post so that you can see what i want to do now; the flowchart on the left of the page is what is being outputted, and the flowchart on the right is what I want to create with the next step.

If anyone could help me with the VBA code to fix this it would be greatly appreciated.  What I want to create is a new routine that loops through all the expecting shapes on the page, and somehow deletes the connecting lines so that the flowchart appears as the one on the right in the doc I have attached.

Thanks in advance,
Hugh

Hugh

I realised that people might not want to download a visio file becuase of security concerns, my bad.  I have attached a screenshot of the visio page so that you can all see the contents.  You don't need to download the visio file now to see it.

Paul Herber

Do you want to post your XML here as well?
You may need to keep track of where the paths diverged, this is normally done with a stack.

Electronic and Electrical engineering, business and software stencils for Visio -

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

Hugh

Thanks a lot for the help Paul!  I have attached the XML file...

Thanks,
Hugh

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

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

Visio Guy

Hi Hugh,

It should just be a matter of holding onto the right shape variables.

From your image, it looks to me like you are always connecting "shape_last_dropped" to "shape_next_dropped".

You need to somehow be able to retain shape objects, until the diagram is complete. For example if you had objects for: shpInit, shpGather, shpValidation. Then you could connect shpInit to shpGather, and shpInit to shpValidation.

Of course you wouldn't actually create all these objects by hand, you'd need some way of tracking which shape belongs to which xml node. This could be done with arrays or objects or structures. Once the drawing is complete, all the objects will get thrown out and cleaned up anyway.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Browser ID: smf (is_webkit)
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: 237 (show)
Files included: 34 - 1321KB. (show)
Memory used: 1146KB.
Tokens: post-login.
Cache hits: 13: 0.00243s for 26,572 bytes (show)
Cache misses: 3: (show)
Queries used: 18.

[Show Queries]