Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: wapperdude on February 17, 2015, 11:27:28 PM

Title: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on February 17, 2015, 11:27:28 PM
Shown here is a possible schematic capture system.  It is reasonably comprehensive and has many features of dedicated schematic capture applications.

As presented, it uses features not typically found with most Visio schematic symbols...that way, I didn't feel like I was intruding on other individual's efforts.  Many, like Paul Herber, have invested substantial efforts to create extensive libraries of electronic part symbols.  The goal here was to have a component symbol that contained all of the necessary connectivity information.  That way, any netlisting errors ought to be traceable to the symbol, or to schematic drawing errors...assuming the underlying code is correct, of course.  The code tries to catch the drawing errors.  All component shapes must have unique names other than "sheet.xyz".  The names dynamic connector and sheet.xyz are reserved, used only as 1-D shapes for interconnecting parts.  The example NPN shows how a single symbol can have either a schematic view or a layout view and maintain connectivity.  The connector is a smartshape with a variety of features.

Interconnections may use either dynamic connectors or line shapes.  I have not tried curved, freeform, etc...after all, this is a schematic.  The code is "hard coded" for these names.  Errors will occur if conformance is ignored.

There are two macros associated with this scheme.  The first runs thru every page and initializes/generates all of the connectivity associated features.  The 2nd allows the user to switch thru various netname display options.  The macros are accessed in the normal, V2007 way:  menu bar>tools>macro>This Document.

When you open the file, the first page may be overwhelming.  It contains a lot of non-essential, explanatory callouts to highlight the many features.  There is a show/hide button which may be double clicked to hide these.  Or, just delete them altogether.  A 2nd button is a shortcut.  Double click it to invoke the reporting mechanism.  Excel is the preferred output format.  An example for the existing circuit is shown on the reports page...yeah, with more notes.

An apology for the code...I'm not a programmer.  The code is not split into separate modules.  It has been recently re-worked, and there are a lot of comments to help understand what's going on.  I'm sure that it could be written more efficiently, but, my main objective was to show a feasible, comprehensive approach.

Hope this proves to be interesting, and hopefully, inspire a more robust approach.  It is not intended to be a simple, documentation scheme.

Enjoy.
Wapperdude

Edit:  Oops.  On the report page, need to expand the excel worksheet, accidentally left off the "status" column.   :-[
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on February 18, 2015, 09:08:30 PM
Updated the code:
  1.  When connectivity macro runs, it sets connectors to no reroute. 
  2.  Custom netnames initially set to normal netnames. 
  3.  Connector endpoint knows if termination is on another connector or line shape and gets / stores netname as custom text.

But, the Custom netname behavior is still buggy.  Sorry!  Double click the connector and shapedata pops up asking for custom name.  The show macro must be re-run for viewing.  Entering the text directly, has some unpredictable results.

Methodology note:  page property sets line routes to no jumping.  Since connections automatically get dots and netnames are generated, the use of route jumps is unnecessary and clutters the schematic.  A four-way connection, (used to be avoided by rule) will have dots.  Any connection that looks like it terminates upon an orthogonal connection but has no dots is NOT connected. 

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on February 19, 2015, 01:07:49 AM
Ah!  I believe the custom text bugs have been exterminated.  Connector names may be manually entered by
  1. Selecting the connector and typing or
  2. Double clicking the connector and using the pop-up shapedata window.

If either field is blank, I mean NOTHING, then the custom text will return to default. 

The prompts to discard or keep the custom text are less confusing.

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on February 19, 2015, 03:43:31 AM
One more, minor update. 

Right click anywhere in the page brings up context menu that allows you to choose which macro to run.  Quick and easy!

OK.  That's it for tonight.

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: cliff50 on February 19, 2015, 05:48:59 AM
Hey Wappadude.

This application is great !  :D  I see many useful features.

cheers
Cliff
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on February 19, 2015, 06:18:48 AM
Thanks.  It is a work in progress.  Reasonably solid considering there's not been much testing.  Hopefully, there're "features" that could be used in other applications.

Even the call-outs are smart shapes:  0 - 3 arrows, 0 - 2 elbows, variety of baseline shapes, text can match line color. -- Just a right click away!
Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Noisy Cricket on September 18, 2015, 07:41:27 AM
On first glance,  would you reckon it's possible to mimic a ship's ballast line diagram, including pumps, valves and overflows?
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Yacine on September 18, 2015, 10:54:16 AM
a ship balast line diagram is a P&ID? Isn't it?
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Noisy Cricket on September 18, 2015, 02:23:07 PM
Uhm.... P&ID?
Yes, pretty much. As long as the components have some kind of way of showing the flow of water based on a given combination of open/closed valves.
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on September 18, 2015, 02:36:04 PM
Yes, this ought to bee possible. Take a look at the shortest path post:  http://visguy.com/vgforum/index.php?topic=6373.0.

It keeps track of flow directionality.  Between that post, and this one, I suspect with some work, like checking an open/closed property in the valve shape, could do what you want.

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Yacine on September 18, 2015, 02:54:35 PM
I do actually have a solution to show active pipe and aggregates paths in a line depending on the use mode.
It generates bitmaps of the given mode.
Not sure however if I can publish it, as I use it for my job.
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Noisy Cricket on September 19, 2015, 07:49:51 AM
Well... first things first.... I need to understand how it works, from there I should be ok.

I'll try and get an actual ballast line diagram to work with.

Primary components:
1) Pumps
2) Valves (several types but that shouldn't matter for the purpose)
3) Vent lines (flooding point)
4) Tanks

Would be really interesting to see if we can "simulate" an actual ballast operation in Visio....
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Yacine on September 19, 2015, 08:53:32 AM
The dialogues are in German, but you should understand what it is about:
https://youtu.be/WpKFGgEjGPg
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Noisy Cricket on September 19, 2015, 08:37:09 PM
Look promising... Didn't get any sound with it though.

It's halfway there.


The idea is to start out (for instance) with all valves closed and pumps off.
Switching on the pump would pressurize all lines  (ideally changing color or thicknesS) until it connects to a closed valve.
Upon opening this valve, the line behind the valve would then also pressurize and change color and so forth.

Suppose this would require one or multiple loops cycling through the actors and lines as well as some master shapes (tank, pumps, air vents, valves (throttle, butterfly, sluice etc.), manifolds, T- and Y joints, crossings.....

The solution has to lie in the "connected/connect"-functionality but as a master of none, i've not mastered this either. :)

My goal would be to use no more code/forms than necessary. Personally prefer the actions at page level above user forms.

I've conjured up a simple schematic with 2 pumps, 2 seachests, 2 tanks and an overflow.
The goal is to have Visio realize which parts of the system are pressurized, under suction and which are not.


Any thoughts?










Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: Noisy Cricket on February 16, 2016, 05:45:12 PM
Really?!?! nobody wants to have a crack at my ballast schematic?!

Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on August 01, 2016, 02:42:34 AM
Major code upgrade.  Corrects some errors caused by absence of named rows in the Connections section of shapesheet.  Makes this more universally applicable.

The code is easier to follow and more steamlined. It uses a dynamic array to store info rather than the placing them in user section of the lines and connectors. 

The main macro also will highlight floating connectors and lines, that is, those that only have one end connected.  Additionally, if a connector or line are connected to another connector or line, a dot is added to show connectivity.  Thus, there are two visual aids to indicate lack of connectivity.  Line color and no dots.

The ship to / from Excel macros have not been updated to work specifically with the new macro.  So, that would take some additional effort.

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on August 18, 2016, 10:21:53 PM
Full update attached.  This will now accept shapes with or without connection points, i.e., walking glue points are OK.  These are reported as "PinX".  The added connection points may either be un-named or named.  The report lists by page, then by 1D "connector".  Each connector row lists To/From shapes and info about the connection point.

As before, there are various options that may be "activated" within the subroutine, e.g., to delete all non-connected 1D shapes.  Floating connectors, i.e., just one end glued, are colored yellow for visual identification.  The program will add "dots" where two or more 1-D connectors are attached to each other.  If connectors are colored, their coloring is preserved.

There is ONE main macro to run, 3 subroutines in all.  The main sub does all of the connectivity analysis.  Info is stored in an array.  The export to Excel sub is called when analysis is completed.  That sub will export connection data to Excel, and then formats the worksheet.  There is a new worksheet for each Visio page.  The Excel window is normally not viewed, but options at end of macro can be chosen for viewing / manual saving / closing.  This sub-routine will call final subroutine to import Excel formatted worksheets back into Visio.

This final macro will call back the Excel worksheet, and paste it to a new Visio background page.  There is one new page per Excel worksheet, which means there is a corresponding Visio foreground page.  Worksheets are on background pages which excludes them from connectivity analysis.  Note, if there is a huge amount of connectivity on any given page, the Excel import may fail, i.e., get truncated.  For such cases, the saved Excel file will have all information.


This connectivity analysis system should be very generic and work with most any Visio drawing...but, I've not tested the validity of that statement.

Enjoy.
Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on August 30, 2016, 07:21:22 PM
Well, one more update.  This is to the Excel sub module.  Added the ability to automatically save the Excel generated file.  It will grab and use the name of the Visio file, and then save in the same directory as the Visio file.

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on November 08, 2016, 07:46:10 PM
Here's example of using macros to add connection points around a shape.  It adds 2 points per side.  The code has the basic steps to add either normal connection points or named connection points...two separate macros.  The number of points is "hard coded", as the effort was focused on the fundamental steps of adding the points.

This was written for V2007, but should work with other versions.  Newer versions might have enhanced features not available with V2007.  Also, I think V2007 has a "bug" wrt named connection points.  Namely, you cannot specfy the connection point behavior via cell "C", i.e., inny, outy, or in/out.  All you get is an "in" point type.  You can manual place an entry into the cell, but it has no consequence upon connection point behavior.

Wapperdude
Title: Re: Schematic capture schema: connectivity, reports, diagnostics
Post by: wapperdude on November 09, 2016, 06:48:37 PM
Here's updated shape.  Pin5, and only pin5, have text (label, pin number) shapes that incorporate SETATREF functionality.  So, the pin text will follow the location of the pin, but, the text may also be independently placed relative to the pin location.

Wapperdude