Trying to automate the "catalogging" of drawing reference designations.

Started by RudySchneider, October 27, 2015, 01:30:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RudySchneider

So, I've completed a large stack of multi-sheet drawings.  I also have an Excel spreadsheet that contains the Bill Of Materials for all of the individual assemblies and harnesses, each of which has a Reference Designator.  What I would LIKE to do is come up with a way to automate the search through all the drawings to determine on which drawing(s) each Reference Designator appears.  Clear?

So, I can do this task manually, by doing a file content search in Windows Explorer.  The obvious problems are that this 1) takes a long time to do, and 2) is subject to human transcription errors.  I already asked gurus on an Excel forum, but apparently VBA doesn't have the necessary "hooks" to be able to read Visio file (.vsd) content.  Frustrating, given that I can do it in Explorer!

Has anyone else run into this and found a solution?
There are no problems, only opportunities

wapperdude

From within Visio, this could be easily done with VBA, perhaps even with the report add-in and avoid VBA altogether.

Not at my computer at the moment...but vs can loop thru all pages, loop thru all shapes on the page, collect both page info and shape info.

Report utility can give you shape info, just unsure about the page info, but pretty sure it'll do both.

Wapperdude
Visio 2019 Pro

RudySchneider

Wapperdude ---
Yes, I know it's relatively easy to set up from within Visio itself, and I may have to resort to that in the long run.  But it's not the ideal workflow, because it's reverse  to my "ideal" process, and may still require error-prone manual transcription.

The BOM is in Excel.  The BOM and/or any of the drawings may change from time-to-time.  Ideally, I'm trying to automate a way to go through the BOM to make sure each Reference Designator that appears there is also located (somewhere) on one or more of Visio drawings.  And at the moment, all I need to know is which drawing(s), without having to know which page.

As I mentioned in my original post, I've managed to already complete the task manually using Windows Explorer.  That helped me identify "gaps" in the drawings, which I went back and corrected.  At the risk of repeating myself, I'm looking for a way to automate the process, which will give me better assurance that I haven't missed something, or transcribed numbers.
There are no problems, only opportunities

Yacine

Hi Rudy,
you can code Visio from Excel.

I attach a file containing some routines, which are the base for remote controlling Visio. I do use them in an MS Access environment, you may need to correct the one or other line of code. But this should get you started.

HTH,
Y.
Yacine

RudySchneider

THANKS, Yacine!  I'll check it out.

Oh BTW, one of the things I ran into on the Excel forums is that the FileSearch function, which I was relying on to help, was dropped from Office 2010, and I hadn't taken time to look into the prescribed replacements.
There are no problems, only opportunities

Yacine

FileSearch?
If you mean the file dialog box, where the user can select a file. It is included.
If on the other hand you mean some automatic file searching routines. I haven't any. But the internet certainly has. ;)
Yacine

RudySchneider

I was referring to the (old) VBA .FileSearchObject command.
There are no problems, only opportunities

ThirdDimension

Hi Rudy,

I admire your work with wiring diagrams in visio.  I am interested in putting together a shape that can grow when stretched.  For example (see attached) I would like to build a shape with the ability to pull the bottom of the connector down, adding connection points accordingly. 

Have you ever built something like this?

I know that you built a connector that allows the user to input the a pin out.

3rd D

RudySchneider

Hi, ThirdDimension.  A couple of observations/suggestions:

As you stated, the connector shapes I created will "grow" by populating the pinouts, true.  For my shape, you assign the pins as a comma-separated string.  Each comma "bumps" the location of the next pin number.  Inserting a string of commas adds more space between the pins.

I typically only assign numbers to the jack-side of connectors in a wiring diagram, while the plug just has an equal number of spaces.  Obviously, that works best with a schematic that has both mating parts, and you could just as easily put the pin numbers (or letters) on the plug side, if you so desire.

And by the way, the connector shapes I created automatically insert connection points at each pin location, whether it's blank or not.

I also created a shape that automatically populates connection points around a box, at locations you can specify.

I've attached a Visio file with both types of connector (horizontal and vertical, along with the connection-point box).  I have many more shapes that I created to aid me in drawing schematics, but perhaps these will give you some ideas for how to create your own.  Oh, and for the record, I had a lot of help from members of this forum as well as a Visio-sharp fellow I located in England through a Google search.

A couple of additional notes:
1.  All my shapes start out as RED.  That makes it easy for me to see what I've created as new, or modified. Once the drawing has been checked as correct, I set up all the shapes so that you can select them all and simply change the line color, which also changes the text color.
2.  Since I rely so much on consistent spacing as much as I can, I also created a shape for text, whose line spacing I can easily select to correspond with the connector spacing.
3.  As you'll see in the attached Example file, the connector shape can be defined to be partial or complete.  And, since I found a use for it, you can turn off the surrounding envelope, which will be unaffected by any line color change.

Hope this helps --- Rudy
There are no problems, only opportunities

ThirdDimension

Thank for the upload Ruby,

I had a chance to look it over and I am interested learning more about the box that automatically populates connection points.  I think this would be best for my purposes.

Here is a brief summary of my situation:

My design work will always be done on 11 x 17 Ledger (no scale), so I am designing all shapes with a 4.4 mm spacing.  This gives a tight, but not overly compacted spacing.  Even with ledger size, I usually need more than one page to show the entire wiring interface. 

I indicate new components and new wiring with solid lines, and existing components and wiring is indicated with dashed lines.  This is similar to your color differences.

For a complex design, a drawing might include 15 new boxes interfacing to 30 or so existing boxes.  At times, I will only have one or two wires going to an existing box, or I may have many wires passing through several disconnects to reach final destination.

I would like to build two shapes:

1) A box that will automatically populate a connection point (4.4mm spacing) with 2 text fields; one for the pin out, and one for the pin function description.  I would like to be able to drag (stretch) the connector up or down to increase / decrease the population. 

2) I also would like to re-size your comma string shape to a 4.4 mm spacing.  This would be great for adding smaller (2, 4, 9 pin) complete connectors

For both shapes, I only need a 4.4 mm spacing, and I could manually work out the spacing by deleting text fields or adding comma's respectively.

Can you help me with the coding for each shape?   

 


RudySchneider

Third Dimension ---
A couple of simple adjustments to the User-defined cells and the Shape data in the ShapeSheet is all that's needed for item #2, but I'm afraid you may have to seek additional help from the REAL Visio gurus with adding your other needs.  It took me quite a bit of trial and error before I achieved the results that were specific to my needs, and I'm certain you can as well, with a bit more in-depth knowledge than I possess.

One of the things that helped me, at least with textual spacing, is to account for font size.  1 point equals 0.35278mm.  So, if you want to be certain to properly space characters vertically, you need to account for this.  Thus, for proper spacing before and after a character, I used the formula

SPACE (before&after) = (DESIRED SPACING (in mm) - (font point size * 0.25278))/2

Good luck.  Oh, and the British Visio guru who was so helpful to me is David Parker, who posts a Visio blog at http://blog.bvisual.net/.  You may want to try contacting him with your request.
There are no problems, only opportunities

ThirdDimension

thank you Rudy,

I was able to successfully tweak your connector to fit my needs.  I also like the way it automatically underlines lower case.

Is their a reason you put the flip on a right click option?  I noticed that CTL H (horizontal flip) does not work.

I just added a 4.4mm spacing option, then hid the spacing option from selection.  I was also able to add command to swap between dashed / solid line depending on new or existing (user defined)

I really like this connector!!!!  I will see if David can help me at bVisual, and may also ask for more help on this forum.

3rd D

RudySchneider

3rd D

Ctrl-H would flip everything, including the location of the connector ID, which could be problematic.  So, it's a selection, instead.

Glad you were able to make some progress.  And I'm pretty sure David will be most helpful.

--- Rudy
There are no problems, only opportunities

ThirdDimension

Hi Rudy,

I have a quick update for you.  I was able to build a shape that works.  The connector points populate based on shape height (in 4.4mm increments)

Text fields for pin out and pin description show/hide with each connector point depending on shape height as well.

I am using layer membership to show/hide the text.  It works nice, but I am having an issue with the shape when pulled from stencil to page as I lose my layer membership codingon the text fields.

3rd D