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

wapperdude

#4
*** Major Alert ***
This is a major update to the code.
1) Dbl click the shape to easily access the Shape Data
2) Separate macro to augment naming the pins.  Main macro asks to name pins (calling this macro), or this macro may be run separately on selected shape to add or rename after shape creation.  Note, a blank entry will delete the name.
3) Main macro now asks for pin spacing and number of pins per side.  No longer hard coded.

Once a shape is created, it is possible to change pin spacing via Shape Data.  In doing so, a larger value will increase shape size.  Smaller value does not automatically reduce size.  That may be done thru normal, manual resize methods.  Action, right click menu still allows options to hide pin numbers and pin labels.

See attached file.
Visio 2019 Pro

mikes

Thanks for creating this!  Sorry this is such a newbie question.  I tried using this a bit to see if I can get the connection point information to be included in a shape report.  I am trying to build a wire table based on the shapes and connections. I was not seeing this being possible.  Thoughts?

wapperdude

Not sure I fully understand your goal.  A little more detail as to what you're doing, what you mean by shape report. That would better explain "not possible".  Plus, describe what your report needs to show.  I suspect you may want things like wire gauge, color?
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: 243 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1123KB.
Tokens: post-login.
Cache hits: 13: 0.00135s for 26,715 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]