Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: wapperdude on February 05, 2019, 10:40:36 PM

Title: Find Complete Path: shapes and connectors
Post by: wapperdude on February 05, 2019, 10:40:36 PM
Chalk another one up for new Visio.  The following development finds all shapes and connectors that are interconnected.  It does not differentiate the direction of the connected.  Think of a circuit board or wiring diagram. Component A connects via trace 1 to Component B who's connected to Component C via trace2.  The code allows for connector to connector connections, shapes with multiple connections.

To use, select one object.  It may be either a shape of a connector.  Run macro.  All interconnected objects are highlighted.

The code consists of an interface model that determines the type of connection selected.  It then makes the appropriate call to either of two sub-modules.  One looks for shapes attached to a connector and the other looks for connectors that are attached to a shape.  These two modules call each other recursively.  Each sub-module uses the "highlight" color to avoid endless looping by eliminating already colored objects.  Both modules use the GluedShapes method.

Here's a test / evaluation file.