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

Menu option to resize shape

Started by goltoof, April 20, 2011, 09:25:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

goltoof

I got a grouped shape consisting of a big rectangle and a bunch of smaller shapes on top of it.  I want it so when I right click on the shape, the menu gives the option to resize the height of the big rectangle by certain number of inches (ie, 6, 12, 14, 24.. not incremental) while not affecting the shapes on the top of the rectangle.

I attached a diagram to show what I mean.

How do I go about this?  Can I get an example please?

wapperdude

One approach:
1st, do not group the shapes.  Otherwise, the small shape will resize with the large on a group basis.  Rather, force the small shape's PinX and PinY to be locked to the top of large shape. 

Let's say shape.1 is the large, and shape.2 is the small.  So, in shape.2's shapesheet, set Piny = guard(shape.1!pinY+shape.1!height*0.5).  For PinX, = guard(shape.1!PinX).  This assumes that shape.1 has LocPinX=width*0.5 and LocPinY=height*0.5.  Now,still in shape.2 shapesheet, set LocPinY=0.  These changes should lock shape.2 to the top of shape.1.  It will move with shape.1 position and height.

Next, select shape.1 and add Shape Data to the shape.  Not sure how it's done in V2010, but in V2007 right click > Data > Shape Data.  Say "Yes" to add data.  Under data type select fixed list and enter your values.  I don't remember the exact format for this, but the help file should explain.  Make sure to check the Ask on Drop box.  Now, in shape.1's shapesheet, you must put a formula in the height box found in the Shape Transform section, something like =guard(Prop.row_1.value)

That should do it.

HTH
Wapperdude
Visio 2019 Pro

goltoof

Quote from: wapperdude on April 21, 2011, 03:15:14 PM
One approach:
1st, do not group the shapes.  Otherwise, the small shape will resize with the large on a group basis.  Rather, force the small shape's PinX and PinY to be locked to the top of large shape. 

Let's say shape.1 is the large, and shape.2 is the small.  So, in shape.2's shapesheet...


Sorry, I'm not sure how to reffer to shapes in shape formulas.  How do I set the name of "shape.1" and "shape.2" so I can set the pin locks?

BTW shape.2, at the top is actually a bunch of shapes.  I have 10 or so shapes above the big box.  I assume if I group them all together they will all be one shape that I can reference in a formula?

I really should already know this. Formulas and shapesheets just aren't my forte :/




wapperdude

Not a problem, my answer was somewhat cryptic. 

Yes, you can treat the grouped shape as a single shape, and all the members will follow.  See the attached example.  It'll be easier for you to open the shapesheets and compare to the instructions previously given.

I added a fill to the main shape to help identify it.  For reference regarding shapesheets, see here:  http://msdn.microsoft.com/en-us/library/ms427031.aspx

To open a shapesheet, 1st select the shape, then, go to the menu bar>Window>Show shapesheet.

There is one other feature to add, which I forgot to mention.  In the shapesheet for the main shape, scroll toward the bottom to the Event section, then in the double click box add the following:  DOCMD(1312).  Now when you double click the main shape, the Fixed List will pop up to show the height choices.

HTH
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: 215 (show)
Files included: 35 - 1407KB. (show)
Memory used: 1056KB.
Tokens: post-login.
Cache hits: 15: 0.00343s for 26,741 bytes (show)
Cache misses: 5: (show)
Queries used: 18.

[Show Queries]