Author Topic: Adding multiple connection points to a shape at once  (Read 1415 times)

0 Members and 1 Guest are viewing this topic.

JB-Tech Racing

  • Newbie
  • *
  • Posts: 4
Adding multiple connection points to a shape at once
« on: February 16, 2023, 06: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.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4841
  • Ideas Visio-lized into solutions
Re: Adding multiple connection points to a shape at once
« Reply #1 on: February 16, 2023, 06: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
Visio 2019 Pro

Surrogate

  • Hero Member
  • *****
  • Posts: 1809
    • ShapeSheet™ Knowledge Base
Re: Adding multiple connection points to a shape at once
« Reply #2 on: February 16, 2023, 11:21:34 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
There is no hyperlink

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4841
  • Ideas Visio-lized into solutions
Visio 2019 Pro

JB-Tech Racing

  • Newbie
  • *
  • Posts: 4
Re: Adding multiple connection points to a shape at once
« Reply #4 on: February 17, 2023, 10:53:26 AM »
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!

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4841
  • Ideas Visio-lized into solutions
Re: Adding multiple connection points to a shape at once
« Reply #5 on: February 17, 2023, 01: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:
Code
'**********************************************************
'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.
Visio 2019 Pro

JB-Tech Racing

  • Newbie
  • *
  • Posts: 4
Re: Adding multiple connection points to a shape at once
« Reply #6 on: February 19, 2023, 01: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.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4841
  • Ideas Visio-lized into solutions
Re: Adding multiple connection points to a shape at once
« Reply #7 on: February 19, 2023, 04: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.
« Last Edit: February 20, 2023, 02:16:10 AM by wapperdude »
Visio 2019 Pro

RudySchneider

  • Full Member
  • ***
  • Posts: 95
  • Old Dog Learns New Tricks
Re: Adding multiple connection points to a shape at once
« Reply #8 on: February 20, 2023, 03: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.

« Last Edit: February 20, 2023, 03:50:30 PM by RudySchneider »
There are no problems, only opportunities

JB-Tech Racing

  • Newbie
  • *
  • Posts: 4
Re: Adding multiple connection points to a shape at once
« Reply #9 on: February 20, 2023, 04:11:51 PM »
Thanks guys! greatly appreciated.