• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3283
  • Last Modified:

Visio (any version) - Cisco shapes, text label annoyance!

In the last 3 versions of Visio (2003, 2007, 2010), I've had an annoying issue with the official Cisco shapes.

When adding a text label to the shape (i.e., 2x click the shape to give it a name, label, IP, etc), the label text WILL NOT extend horizontally past the edges of the shape.

The attached image are 3 copy/pastes of the same shape, same text.
  • 2
  • 2
1 Solution
Normally, I don't apply the default text label but rather insert my own text label formatted how I want it and then select both the text label and the shape and group them together.
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
This problem is actually pretty easy to solve but it does require a small amount of "surgery" on the shape.

As you may or may not realize, every aspect of a Visio shape is controlled by settings in the "shapesheet" -- it's a spreadsheet-like collection of data that exists behind every object in Visio. All we need to do is make one change in the shapesheet for the Cisco shape to change the width of the text block.

In this case the problem is complicated very slightly by the fact that the switch object is a group consisting of multiple layers and the text we want is not on the group itself, but on a shape within the group (you'll see how I determined this in just a moment).
  1. Select the Cisco shape by clicking once
  2. Open the shapesheet (select Window>Show ShapeSheet from the main Visio menu)
  3. Scroll down to the Text Block Format section. What we actually want to look at is the Text Transform section but there isn't one for this shape; that's how I knew we needed to dig a bit deeper.)
  4. Click a second time on the Cisco shape, which will select the first subshape in the group. [Notice that the green handles around the edge of the shape change from open green squares (meaning that you can drag them) to green squares with X's in them (meaning that the subshape is locked).]
  5. Open the shapesheet
  6. Scroll down to the Text Transform section; the first picture below shows what you should see. Notice that the formula in the TxtWidth cell is "Width*1" -- this is what causes the behavior you observed: the width of the text is always equal to the width of the shape.
  7. Enter the formula shown in the second image below and press enter; the width of the text block will now be as wide as it needs to be and is no longer tied to the shape width.
  8. Close the shapesheet window
Now that you've modified the shape to behave the way you want it to, you'll probably want to drag it into a stencil of your own so you don't have to make this change again.

snowdog_2112Author Commented:
Can I give you 2,000 points for that?!!

I can't tell you how many different half-crocked answers I've found.  Yours is not only correct (most importantly) but the screenshots were helpful!

Thanks again!
snowdog_2112Author Commented:
Is there a way to change the shape before it's placed on the page, so any new shapes will have that same property?
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
Glad to help...

Yes, you can change the shape "ahead of time" -- in essence what you want to do is create a new master in a stencil that you can then reuse. (As an aside, for the correct terminology re masters, shapes and stencils see this article.). You can either drag your modified shape into the Visio-provided stencil (Visio will warn you that the stencil is read-only and will offer to open it for you) or you can click File>Shapes>New Stencil and create your own stencil.

BTW, if you have a bunch of existing drawings that have shapes you want to change, it's pretty easy to write a macro to fix the text width formula in all of them at once. Just post another question, along with a sample drawing, and I'll be glad to provide a short macro.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now