Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: Bob33S on January 22, 2019, 12:35:11 AM

Title: Wiring Diagrams
Post by: Bob33S on January 22, 2019, 12:35:11 AM
I'm rather new at Visio, but I would like to submit a wiring diagram project that I have been working on.
It is not perfect, but a work in progress.

This is a mostly a modification and adaptation (or butcher in some cases) of code from the web site.
Dual Labeled connectors
Text Along a Connector's Path
Smart connectors
Finding sub-shapes in a group
Auto numbering connectors
Just to name a few.

The underlying premise is that everything, except connectors, are a piece of equipment (with a reference designator) and Ports are added to make connections.

When you drop the "Port" shape onto the "Equip" shape it gets data from the "Equip" shape.
The Dual Labeled connectors collect data from the port that it connects to.

There are a few issues that I have not worked out.
I would like to automatically update the "RefDes" in the "Ports" when the "Equip" Shape Data "RefDes" is changed.
I also have problems skipping shapes that do not have a "RefDes" cell.


I would like to thank the VisioGuy, Dmitry and others for the inspiration.

Title: Re: Wiring Diagrams
Post by: zipwill on February 06, 2019, 11:48:46 AM
Wow - that is really interesting.  Certainly not newbie stuff....

Have you sorted any of the issues?  I will watch with interested as this can apply to me.

Thanks
Tom
Title: Re: Wiring Diagrams
Post by: wapperdude on February 06, 2019, 09:36:30 PM
QuoteI also have problems skipping shapes that do not have a "RefDes" cell.

You can search a shape for a specific cell to see if it exists: 
    If shp.CellExists(somecellname, Visio.visExistsAnywhere) = 0 Then
          do whatever code
    end ifs

Referrence:  https://docs.microsoft.com/en-us/office/vba/api/Visio.Shape.CellExists (https://docs.microsoft.com/en-us/office/vba/api/Visio.Shape.CellExists)