Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: JB-Tech Racing on February 16, 2023, 11:07:11 PM

Title: Adding multiple connection points to a shape at once
Post by: JB-Tech Racing on February 16, 2023, 11:07:11 PM
Hey guy, not sure this is the right section, but here goes.
I design wiring harnesses and schematics, so Im often adding in components that have LOTS of connection points. Some upwards of 200 points.
Is there a way to add multiple connection points too a shape without using the shape sheet and doing it one at a time?
Ive been trying to use excel data to do it, but just cant quite figure it out.

Any help is appreciated, thanks.
Title: Re: Adding multiple connection points to a shape at once
Post by: wapperdude on February 16, 2023, 11:28:27 PM
This topic may be of interest...uses macro to create shape with connection points and labels.  Should work for your high pin count.
Shape Creation: with connections pts & labels using macro (//http://Shape%20Creation:%20with%20connections%20pts%20&%20labels%20using%20macro)
Title: Re: Adding multiple connection points to a shape at once
Post by: Surrogate on February 17, 2023, 04:21:34 AM
Quote from: wapperdude on February 16, 2023, 11:28:27 PM
This topic may be of interest...uses macro to create shape with connection points and labels.  Should work for your high pin count.
Shape Creation: with connections pts & labels using macro (//http://Shape%20Creation:%20with%20connections%20pts%20&%20labels%20using%20macro)
There is no hyperlink
Title: Re: Adding multiple connection points to a shape at once
Post by: wapperdude on February 17, 2023, 07:31:23 AM
Oops.
http://visguy.com/vgforum/index.php?topic=7543.msg31951#msg31951 (http://visguy.com/vgforum/index.php?topic=7543.msg31951#msg31951)
Title: Re: Adding multiple connection points to a shape at once
Post by: JB-Tech Racing on February 17, 2023, 03:53:26 PM
I downloaded the Macro but Im struggling to figure out how to run it. Im new to visio, so go easy on me. Ive been googling ALOT!
Title: Re: Adding multiple connection points to a shape at once
Post by: wapperdude on February 17, 2023, 06:27:12 PM
Ah!  I forgot what state of development that this is in.  It is in manual entry, so you have to open up the macro and enter the desired information...number of connection points per side, connection point spacing.  The macro will build the minimjum sized shape to accommodate these settings.  For example, you might want to do settings like this for 200 points:

'**********************************************************
'Manually enter the desired pin to pin spacing and
'the number of pins across each edge of the shape.
'The pin to pin spacing will become a main shape property that
'can be accessed from the shape.  Scales both the pin spacing
'and the size of the shape.
'**********************************************************
'
    iRow = 0
    pSpc = 0.1
    nlp = 60
    nrp = 60
    ntp = 50
    nbp = 30
   
    pX1 = 1     'Initial shape placement coordinates
    pY1 = 1
   


But you could put all 200 on a single side.

Once these changes are made, run the macro.

One way to access the macro is  1) enable Developer Mode, then on the left side of Developer tab, (or Alt+f11) select Visual Basic. This opens the Visual Basic Window.  On the left side you should see something like Visio Objects>ThisDocument.  Dbl clk ThisDocument.  This displays code in main window.  Scroll down until you see the section of code as shown above.  Edit per my example or whatever you need.  Then run the code.  With 200 connection points this might take awhile.
Title: Re: Adding multiple connection points to a shape at once
Post by: JB-Tech Racing on February 19, 2023, 06:41:08 PM
Thank you! Im getting it figured out. Now to add labels to each pin. I'll see if I can figure that out just poking around. I see it automatically labels them 1-X. So now I just gotta figure out how to add the ECU Pin# and its function.
Title: Re: Adding multiple connection points to a shape at once
Post by: wapperdude on February 19, 2023, 09:00:22 PM
The "manual" way to enter pin labels...  With the shape selected, open shapesheet and scroll to Connection point section.  Using dbl quotes, enter label text into the D-Cell.  Also, the pin type C-cell entry may be changed here if desired.   DO NOT edit the pin label directly as this will clobber the link to the connection point D-Cell.

When this code was written, there was no anticipation for high pin counts, thus manual entry was OK method.  It could be automated if, say, an Excel file existed which contained the desired info.
Title: Re: Adding multiple connection points to a shape at once
Post by: RudySchneider on February 20, 2023, 08:31:16 PM
Quite some time ago, I had a similar need for schematics I was creating.  So, I made a stencil of various "standard" components, including boxes and electrical connectors with connection points.  These were to be used on E-size sheets, so they were rather large, but I gave each object the ability to define the spacing between connection points.  Anyway, I've put three shapes --- vertical and horizontal electrical connectors, and a box with connection points around its periphery --- and attached it here.  If you can't use it directly, you may be able to edit the Shape Sheet(s) to better suit your needs.

(//)
Title: Re: Adding multiple connection points to a shape at once
Post by: JB-Tech Racing on February 20, 2023, 09:11:51 PM
Thanks guys! greatly appreciated.