Author Topic: Find Complete Path: shapes and connectors  (Read 233 times)

0 Members and 1 Guest are viewing this topic.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3426
  • Ideas Visio-lized into solutions
Find Complete Path: shapes and connectors
« on: February 05, 2019, 05: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.
Visio 2019 Pro