How to keep a shape from getting garbled when resizing

Started by Mosey, May 27, 2009, 01:59:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mosey

I'm a newbie at Visio. I created a new shape that is basically a rectangle with text inside. I turned on the following Protections: Aspect Ratio, Text, Format, From group formatting. Please see attachment "shape 1.jpg". But, when I place this shape in a drawing and then try to resize it, the text inside gets all garbled. Please see attachment "shape 2.jpg". It doesn't resize with the rest of the shape. How do I fix this?

Paul Herber

First, undo all those protections that you've set.
Select the whole shape and
menu Format -> Text
and set a suitable text size or use the font size on the toolbar.

There is, of course, the possibility that the parts of the shape (it's a grouped shape) have protected the text size od the individual parts.

Electronic and Electrical engineering, business and software stencils for Visio -

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

wapperdude

Beyond what Paul says, requires editting the shapesheet to add a formula to make the character size respond to the shape size.  This is not a normal feature.  It is not difficult to do, although your grouped shapes add a small complication.

So, if interested, here's the basic steps...
1.)  Go to the menu bar > Window > Tile.  Then menu bar > Window > Show shapesheet.  (You should see both the drawing and shapesheet windows.)
2.)  Create a width based calculation constant (this step is optional, mainly for convenience)
       a.)  In the Shape Transform section note and record the value for the Width cell.  This value will be used later.
       b.)  Now, right click in the shapesheet window, select insert section, select user defined cells
       c.)  In the User-defined Cells section, click on the cell that contains "user.Row_1", hit enter, type "antiSize" -- without the quotes, and hit enter again.  The row title should be User.antiSize.  (This step wasn't necessary, just adds unique name to the row.)
       d.)  Now, click in the value cell and enter this formula:  Width/ref value.   Where ref value is the number you observed in step a.

3.)  Scroll down to the Character section.
       a.)  The Size cell should contain something like: 24 pt. 
       b.)  Modify this entry to look like:  (24 pt)*User.antiSize

That's all of the shapesheet entries.  You may close the shapesheet.

Here's the grouping complication:  The above was for a per shape entry, and so, needs to be repeated for each sub-shape in the group.  Also, I would maintain the protection on the aspect ratio.  The formula is strictly based upon width, so, if the height is changed without affecting the width, the text size won't be changed.

One final caveat:  this only works about 90% of the time.  As the shape shrinks, there comes a point when Visio may add another line wrap.  That will upset things, but not as badly as before.  See attached.



Visio 2019 Pro

Mosey

Quote from: Paul Herber on May 27, 2009, 03:00:37 PM
First, undo all those protections that you've set.
Select the whole shape and
menu Format -> Text
and set a suitable text size or use the font size on the toolbar.

There is, of course, the possibility that the parts of the shape (it's a grouped shape) have protected the text size od the individual parts.


Thanks, this seems to work. I can resize the text so it fits the resized shape.

Mosey

Quote from: wapperdude on May 27, 2009, 04:11:57 PM
Beyond what Paul says, requires editting the shapesheet to add a formula to make the character size respond to the shape size.  This is not a normal feature.  It is not difficult to do, although your grouped shapes add a small complication.

So, if interested, here's the basic steps...
1.)  Go to the menu bar > Window > Tile.  Then menu bar > Window > Show shapesheet.  (You should see both the drawing and shapesheet windows.)
2.)  Create a width based calculation constant (this step is optional, mainly for convenience)
       a.)  In the Shape Transform section note and record the value for the Width cell.  This value will be used later.
       b.)  Now, right click in the shapesheet window, select insert section, select user defined cells
       c.)  In the User-defined Cells section, click on the cell that contains "user.Row_1", hit enter, type "antiSize" -- without the quotes, and hit enter again.  The row title should be User.antiSize.  (This step wasn't necessary, just adds unique name to the row.)
       d.)  Now, click in the value cell and enter this formula:  Width/ref value.   Where ref value is the number you observed in step a.

3.)  Scroll down to the Character section.
       a.)  The Size cell should contain something like: 24 pt. 
       b.)  Modify this entry to look like:  (24 pt)*User.antiSize

That's all of the shapesheet entries.  You may close the shapesheet.

Here's the grouping complication:  The above was for a per shape entry, and so, needs to be repeated for each sub-shape in the group.  Also, I would maintain the protection on the aspect ratio.  The formula is strictly based upon width, so, if the height is changed without affecting the width, the text size won't be changed.

One final caveat:  this only works about 90% of the time.  As the shape shrinks, there comes a point when Visio may add another line wrap.  That will upset things, but not as badly as before.  See attached.


I tried this and it doesn't seem to work. I tried it with a smaller test rectangle that just has a few lines of text in it. I grouped it all together then went through the steps you described. The text stays the same size when I resize the rectangle to a smaller size. When you say I need to repeat for each sub-shape in the group, do you mean I need to repeat for each text box? I tried that and the Width is not just a number, it's "Sheet.1!Width*0.8462".

wapperdude

#5
I included a Visio file in the original reply, that has the implementation in it for reference.  You can use that for comparison.   So, one issue comes to mind --  how did you enter the text?  My example assumes that you drew a rectangle and typed directly into it.  If you drew a rectangle, and then a separate text box, and grouped these, then the selection may be wrong.  1st click will select the group, 2nd click will either select the rectangle or the text box, depending which is physically on top.  It is the text box that must be selected and it's shapesheet modified. 

The fact that the entry says Sheet.XX!Width*scale factor, e.g., Sheet.1!Width*0.8462 implies that there is a grouping. 
  a.)  Sheet.1 is the parent, i.e., the group shape
  b.)  The width is scaled from the group shape by a factor of 0.8462.

To get the actual, value of this entry, in the shapesheet, right click, and then select the top entry, Values.  Now all of the cell entries will show their values rather than their formulas.  Beyond that, the User-defined section and character section entries should be done as indicated. 

The critical issue is to make sure that you have the correct item selected before you invoke its shapesheet.  I will modify the Visio file to include a case where a rectangle and a separate textbox are grouped.

HTH
Wapperdude
Visio 2019 Pro

Mosey

Quote from: wapperdude on May 28, 2009, 12:15:23 AM
My example assumes that you drew a rectangle and typed directly into it.  If you drew a rectangle, and then a separate text box, and grouped these, then the selection may be wrong. 

OK, now I have it working. I was adding the text by drawing a rectangle. I deleted it and just clicked on the rectangle and entered the text and now it resizes. If I go too small it line wraps like you said, but I don't need to go that small. Thanks for your help.

Does anyone know of any good classroom training for Visio that goes into this level of detail? All I can find is the basics. Are there any good books out there?

wapperdude

What I found to be most helpful was this site:  http://msdn.microsoft.com/en-us/library/aa245244(office.10).aspx.  It provides a nice organized approach to Visio and very amenable to browsing.  Written for V2002, but still valid.

Another very valuable resource is the V2007 SDK.  It contains documentation and examples.  Available here:  http://www.microsoft.com/downloads/details.aspx?FamilyID=373d34b8-5ef7-4e6e-a582-c8d6b5ee4e33&DisplayLang=en

Of course there is the home page for Visiohttp://office.microsoft.com/en-us/visio/default.aspx.  It has demos, tutorials, and a lot of additional resources.

Visio Guy's Blog site has a ton of information, plus additional links, some book references:  http://www.visguy.com/

This list is not by any means complete, but, I think these represent a reasonably good starting point.

HTH
Wapperdude

Visio 2019 Pro