Author Topic: Help Creating a Custom Shape  (Read 7059 times)

0 Members and 1 Guest are viewing this topic.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • Ideas Visio-lized into solutions
Re: Help Creating a Custom Shape
« Reply #15 on: May 30, 2017, 02:42:31 PM »
Modified shape attached.

Top (group) level:  right click and select desired configuration:  Pos A or Pos B.

Modifications include:
1)  Adding actions to top level shape
2)  Modifying sheet.17 to toggle text.
3)  Modifying sheet.3 to toggle view of geometry1.
4)  Add sheet.45 to group to show alternate contact view. 

This ought to do what you need.

Wapperdude
Visio 2019 Pro

skydiver13

  • Jr. Member
  • **
  • Posts: 15
Re: Help Creating a Custom Shape
« Reply #16 on: May 31, 2017, 09:48:55 AM »
Thank you Wapperdude.  :) :) :) Now, I will use this modification setup for my other shapes. Thanks for explaining.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • Ideas Visio-lized into solutions
Re: Help Creating a Custom Shape
« Reply #17 on: May 31, 2017, 10:44:37 AM »
Glad to help.

Wapperdude
Visio 2019 Pro

skydiver13

  • Jr. Member
  • **
  • Posts: 15
Re: Help Creating a Custom Shape
« Reply #18 on: June 01, 2017, 07:39:30 AM »
Wapperdude, I was trying to replicate what you did and I quite don't understand how you modified the sheets to toggle text and view. If you can, could you please go over in more detail thanks.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • Ideas Visio-lized into solutions
Re: Help Creating a Custom Shape
« Reply #19 on: June 01, 2017, 09:55:26 AM »
Sure. 

Because this is a grouped shape, to keep things simple for the user, most of the commands are added to the toplevel group shape.  This is where the Actions section is implemented.  So, if you select the group, it's sheet.1, in this case.  In the Actions section, there's three entries, the first being a "Title".  The next two establish the actions.  The Checked cell is Boolean.  Either "1" or "0".  It is this cell that determines what goes on. 

Toggle Views:
Now, if you push into the group shape, either by direct selection, or by navigating using the Drawing Explorer window, select either the "Pos A" contact shape (sheet.45) or the "Pos B" contact (sheet.3).  These shapes will alternate their visibility. 

Consider sheet.45.  Go to the Geometry1 section.  At the top, there is entry Geometry1.NoShow.  The following formula is entered, =IF(Sheet.1!Actions.VwA.Checked,0,1).  This sets the toggling.  It refers back to sheet.1 actions.  If Show Pos A view is selected (checked), then it enters value = "0", and the shape is visible.  If not checked, then, formula enters value ="1", and shape is hidden.

Since the action is to alternate between the two views, then, for Sheet.3, the formula is modified to give opposite values.

For the Text:
Select the text shape, it should be sheet.17.  Open shapesheet.  A little bit extra is needed.  First,  need to create entry for the two text labels.  So, I added the User section, and created an entry into row_1.  (I renamed the row to User.VwName.).  There is the following formula:  =IF(Sheet.1!Actions.VwA.Checked,"Pos A","Pos B").  The formula causes the value to switch between the two text strings indicated.  So, half way there.  Now, to show these values in the the shape, I used the Insert>Field menu item.  (Not sure where it is on the ribbon.)  From the pop-up window, select User-defined Cells category, and then select VwName.  Hit OK.

That's it.  That's the mechanics behind doing the toggling.

HTH.
Wapperdude
Visio 2019 Pro

skydiver13

  • Jr. Member
  • **
  • Posts: 15
Re: Help Creating a Custom Shape
« Reply #20 on: June 01, 2017, 12:24:32 PM »
Thank you again Wapperdude.  ;D ;D ;DSince you know so much on Visio, where could I learn more about Visio. If there some good book or tutorial that can teach on every subject in Visio?

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4479
  • Ideas Visio-lized into solutions
Re: Help Creating a Custom Shape
« Reply #21 on: June 02, 2017, 12:04:37 AM »
How to learn Visio?  Books are one way. 
You might want to start here:  http://visguy.com/vgforum/index.php?topic=5034.msg19756#msg19756
This link points to some additional books:  http://visguy.com/vgforum/index.php?topic=2566.msg11137

But books aren't the only way.  This link, although old, so it doesn't do containers, for example, but what it does do is give you a good foundation/understanding for Visio: 
https://msdn.microsoft.com/en-us/library/aa217846(v=office.10).aspx

Also, the free SDK's have many code examples on many topics.  Just google for Visio SDK.

Here's link to video series by the Visio MVPs:  http://www.visguy.com/2012/02/01/roll-em-new-visio-2010-video-series-by-visio-mvps/

While the search engine isn't the greatest, this forum provides a wealth of information. 

Wapperdude
« Last Edit: June 02, 2017, 12:10:38 AM by wapperdude »
Visio 2019 Pro