News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Shape Creation: with connections pts & labels using macro

Started by wapperdude, November 10, 2016, 07:35:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

Felt this needed it's own topic.  The attached file contains two macros.  The difference being one adds standard connection points, the other adds named connection points.  Page-2 was added, demonstrates a newly constructed shape.  Either delete, move shape before creating a new one.

Features:
1) The code can easily be modified to change the pin to pin spacing of the connection points, and to set an arbitrary number of points along each edge.  (Didn't test for 0 pts.  Next version.)
2) The shape automatically sizes to the larger vertical and horizontal edges.
3) It drops a shape on a page, then
    a) locks the selection box sizing
    b) converts it to a group
    c) sets lower left corner as origin / reference point.
    d) adds the connection points.  (The code needs some refining, but gets everything neatly placed.)

Future updates include
    a) correcting code issues.
    b) adding subshapes to hold pin labels and pin numbers.

Wapperdude
Visio 2019 Pro

wapperdude

#1
Major update.  The code now adds "placeholders" for both connection point, aka, pin, text and pin numbers.  Since the pin text leverages the connection point D cell, this implementation is specifically for adding named connection point rows.

Features:
   1)  Accepts zero connection points on any side
   2)  Allows manual resizing of shape, but will not size smaller than necessary to accommodate the pins.
   3)  Uses shape data property to control both size of shape and pin spacing.
   4)  Connection points may be dragged and text placeholders will track.  No, deleting a connection point will not delete the placeholders.  That must be done manually.
   5)  Adds a default reference designator.  The numerical indication is merely the shape ID.  So, doesnot use the auto number routines.
   6)  Definition of the pins per side and the initial pin spacing is still a manual entry into the main routine.  A user form could be created to allow entry of these values.  No intention to do that now.  Once the shape is built, it is possible to modify the pin spacing via (3) above.

Not included:  ability to hide the pin number or pin label text.

The code is partitions into 3 subroutines.  The main subroutine initially calls the main shape construction.  Then, later calls the subshape definition routine to create the placeholders for pin text.

I think this is a reasonably generic, universal shape.

Enjoy.
Wapperdude
Visio 2019 Pro

wapperdude

#2
After some thought, adding the ability to hide the connection point labels and pin numbers seemed like a good feature and not that difficult to do.

So here's another update.  Select main shape, bring up the right click menu, and choose to hide either or both text features.

Wapperdude
Visio 2019 Pro

wapperdude

Minor tweak:  defaulted non-populated D cells do not show content in the shape.  This eliminates shape "clutter" by not showing useless info.

Wapperdude
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 189 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1034KB.
Tokens: post-login.
Cache hits: 13: 0.00162s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]