How do I create a custom shape with alternate symbols?

Started by sgtpepperlhcb, December 04, 2024, 02:35:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sgtpepperlhcb

I'm looking to create custom shapes in VISIO with alternate symbols similar to the resistor shape in the Electrical Engineering Stencil.  More specifically, I'm creating face views for connector pinout and want to have the option for male or female pins (which are mirrored from each other).  How do I do this?

Further information can be found on my Microsoft Forums post:
https://answers.microsoft.com/en-us/msoffice/forum/all/how-do-i-create-a-custom-shape-with-alternate/9bcc3746-cf2f-4a55-b48a-5f664404d460?messageId=e0628929-95cf-4bde-8026-fdc4b567024c

wapperdude

There are two ways to do this:  a smartshape and a semi smart shape.

Smartshape: the various "looks" are each a separate geometry section in the shapesheet.  Plus, Action section in shapesheet to provide right click menu items.  Construction may be tedious, but ultimately, very efficient.  Depending upon menu selection, the geometry sections are either show or noshow. 

Semi-smart:  this would be a grouped shape. The subshapes are overlaid and are either hidden or not.  Bit easier to construct initially, but not quite as efficient.  The parent shape would contain the menu options, plus common elements if desired.

In either case, especially for multi pin objects, e.g., D-connectors, handling the connection point locations requires decision in construction phase. 

In a nutshell, it is all handled via shapesheets.
Visio 2019 Pro

sgtpepperlhcb

#2
I am currently attempting to do the Smartshape option per John's reply to my other post. Trying to figure out the formula to put in the action section. Can I reference a group of geometries, or do I need an action for each geometry (the circles in my example)?

In my experience, shapesheets apply to each geometry. So, how do apply the action to the whole shape?

Nikolay

#3
1. You can just look at the "resistor" shape and copy.

2. No, you cannot reference a group of geometries, so if there are 100 of them, you would need to repeat edit 100 times. The toggle will also not work for groups, if your shape contains groups, you need to go down to every one of them, and then make explicit references to the top shape.

wapperdude

#4
You can edit the document masters located on the document stencil.  Once edited, it will push changes into all drawing shapes that reference that master.  Note, this does not impact the originating stencil master.  It must be updated separately. 

It's good idea to make backup copy of the Visio file before doing any editing.

Check the forum, there may be posts addressing connector construction.  For smartshape, the two biggest issues are connector pin locations and their associated labels. 

You might consider my shape maker to get most of the heavy lifting done.  Specify no pins for left / right sides, desired # of pins top and bottom.  You can move the bottom row to center properly.  Edit the shape outline.  Then, add action menu to control view perspective: male/female.  You will need to add circles for the pins plus any other additions.

To get a feel for possible complexity, take a look at the attached shape.  Added DConn.vsdm which uses the shape maker code with subsequent editing.  This is not a fully completed DConn, just enough to show what may be done.  Note, size is set by double click and setting pin2pin spacing.  Anyway, hope these help.
Visio 2019 Pro

wapperdude

#5
Now for the not so nice bad news concerning smartshape with multiple geometries.  All of the geometry sections share, in common, line, fill, text, etc attributes.  That is, all of the lines will have same thickness, color, line style.  Also, they will all have same fill color.  The only thing that they don't share are the 3 cells: no fill, no line, don't show.  The only way to have different fills is to have multiple shapesheets, and that means a grouped configuration.
Visio 2019 Pro

Yacine

my 2 cents ...

- Except for John's answer, the replies on MS' forum are really poor. Was that AI? They could as well redirect directly to us.
- In the special case of the plug in the example, you can observe a symmetry. Switching from one state to the other would be as simple as toggling the value of flipY:
setf(getref(flipY), not(flipy)
No geometry section involved.
- and yes, you can reference multiple geometries at once - that is if I understand the question well. Say you want to switch the visibility of geometry sections 1, 3 and 5. you define a general variable in the form of a user cell - user.mySwitch - and toggle its value by means of a setf/getref. In the geometry sections 1, 3 and 5 you reference this user cell in the "noshow" field.
Yacine

Paul Herber

I see the latest incarnation of MS's forum is now called
Microsoft Learn Challenge

Well, they don't do they!
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

@Yacine: 
Quote- In the special case of the plug in the example, you can observe a symmetry. Switching from one state to the other would be as simple as toggling the value of flipY:
setf(getref(flipY), not(flipy)
No geometry section involved.
Actually, not true.  There are slight differences visually, besides pin order, that differentiate a plug from a recptacle.  Such differences may include size of the circles and their shading.  Otherwise, yes, your statement is correct.
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: 299 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1187KB.
Tokens: post-login.
Cache hits: 13: 0.00155s for 26,602 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]