Named Connection points.. again.

Started by David_Wallis, November 08, 2016, 12:02:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

David_Wallis

I cant seem to follow the examples I  have found online, but I basically want to draw a rectangle which simulates a device such as an IC / Arduino or some other device that people can visualise..

It has a number of connections IE GPIO, and I want to put these on as connection points with labels attached to them such as AN0 AN1 DIG1 DIG2 DIG3 and then this can be used to create a schematic by using connectors to thes connection points with names / labels.

I would like to be able to resize move etc, but its not a necessity..

Is anyone able to help me as I'm loosing hair now..  I managed to use the D field, but could only then insert one field per shape.. and I feel I'm just being thick. (which isn't a new thing!)

Thanks

David

wapperdude

In order to show shape "pin" information you need a complex shape...each pin needs it own text box(es), one foe each label to be shown.  See this posting:  http://visguy.com/vgforum/index.php?topic=6314.0.  Take a look at the shapes and shapesheet to get an idea how this might be done.

Wapperdude
Visio 2019 Pro

David_Wallis

Thanks, I had looked at this, So I can edit the shape and change the pin numbers to the ones I want, but how do I add new labels?, after ungrouping I cant see how it updates the names?

IE If I want to add a pin 9 to U1 in this example

I can add a connection point..  Edit the row type and set a value for D, but how do I add the text to dynamically update?

wapperdude

#3
To edit existing shape, don't ungroup...that breaks the behavior for pin text.

The original idea came out of the electronics industry where each shape is specially created, difficult to change certain key features, e.g., number of pins, their type, location.  Labels were moderately immune to change, but reasonably alterable.

For the shape, to change: 
    pin labels:  open group shapesheet, then edit connection point D-cell.
    pin numbers:  change group behavior from group only to either of the other two choices. Then click on a pin number, the subshape should select, type in desired, new number.

A word about this shape...
    1) the top level shape IS the group.  Not everyone likes this approach.  It saves on a level of shape hierarchy.  It also allows the pins to be at the top level and directly associated with body of the shape.
    2) the top level shape has its selection box locked, prior to adding anything...shapesheet>protection>LockCalcWH = 1.  That way, adding/modifing pin text number shapes doesn't alter the group size, so shape remains constant.
    3) the pin text, numbers are NOT slaved to the pin locations.  That allows a little more freedom for placing label info, but is inconvenient when moving the pin.  Upon consideration, SETETREF would be a way to accommodate both features.

These were some of the steps I used.  The point is, multiple labels for the pins means each label has to have a "placeholder" shape for the text...and that means some sort of grouped shape.  It's your choice how to handle all of the issues involved with grouping.  Yes, there is a bit of work.

FYI:  at the link I previously provided, there is a new entry that contains a sample of how to add pins around a shape using VBA.
FYI2:  2nd entry containing a proto-typical schematic shape with all of the above mentioned features.  NOTE, only pin5 has the text slaved to the pin.  Move pin, text tracks.  Move text to position as desired.  Text still tracks pin location.

HTH
Wapperdude

Visio 2019 Pro

David_Wallis

Thanks,

However still a little lost as to the steps for how would I go about adding a new connection point and then having a label updated by the appropriate D cell?

Cheers

David

wapperdude

#5
Hi David...

The basic steps are
   1)  add connection point to main shape.  To use D Cell, open shapesheet and change row type for the connection point.  You can now enter a unique name for the row and text into D Cell.

   2) optional step, but recommended.  Convert the main shape to a group.

Now, let's say you want two labels, pin numbers and some text, eg, D Cell entry.

   3) draw a rectangle, size and position it.  At this point, I think it's ok to insert D cell text.  Let's say this is pin 1, and the row is named Connections.P1.  Further, assume the main shape is Sheet.1.  So, with the new shape selected, go to insert field, and do insert_custom and enter formula "Sheet.1!Connections.P1.D".  With the quotes.  The shape ought to display the D Cell text.

   4) add the new shape to the main shape group.  The text should be unaltered.

   5) the text is probably obscured by the main shape.  Select main shape, then format> behavior > select group data behind member shapes.  That's it.  This step only needs to be done once.

   6) for the pin number, add another rectangle, manually enter the pin number, size and position the rectangle as necessary, then add to group.

   7) another option would be to set the rectangle's Pin X, Pin Y locations relative to the connection point position.  That way, if you move the pin, the labels will track with it.  See previously mentioned reference.

Repeat steps 3 and 4 to add additional connection points and / or subshapes.

In the near future, I'll be posting a macro that does these basic steps.


HTH.
Wapperdude.

Visio 2019 Pro

wapperdude

Visio 2019 Pro

David_Wallis

Sorry not had chance to get online in a while, thanks for your assistance, I will give that a go - makes sense :D