Author Topic: Shape behavior: as you type more text, shape expands downwards  (Read 2184 times)

0 Members and 1 Guest are viewing this topic.

2020Visio!

  • Jr. Member
  • **
  • Posts: 14
Wow the shapesheet looks impressively complex for someone new to it! :)

Please see the concept shape diagram with explanation attached.

I am looking to create shapes that expand downwards (in height) as you type more text into the text box. They are top aligned and there is only one connection point on the shape (the connections are also top aligned).

What is the best way to achieve such shape behavior for the amount of text in the text box?

Also, the whole shape inheritance thing in Visio is pretty dizzying for newbies. Is there a really good explanation somewhere that will help bring clarity to this?

Thank you so much!

Jim

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3822
  • Ideas Visio-lized into solutions
Re: Shape behavior: as you type more text, shape expands downwards
« Reply #1 on: August 24, 2015, 02:15:06 PM »
To get the text behavior, format > Text > TextBlock > Alignment = Top.  No need to edit shapesheet...yet.

To get the shape to grow with the text, now, open the shapesheet. 

In the Shape Transform section, edit the entry for height:
Simple formula: =guard(TEXTHEIGHT(TheText,Width))

This locks the height to the text. 

Better formula:
=MAX(SETATREFEXPR(1 in),TEXTHEIGHT(TheText,Width))..  Note, the value, 1 in, is just a placeholder so that the initial height is not zero. 

This allows the shape to be enlarged manually.  It will allow the size to be either the height needed for the text, or some manually set value, whichever is larger

For good, basic background on Visio, check out the following:
   All about Visio:  https://msdn.microsoft.com/en-us/library/aa245244(v=office.10).aspx
   shapesheet reference:  https://msdn.microsoft.com/en-us/library/ms427031.aspx

Wapperdude   
« Last Edit: August 24, 2015, 02:20:13 PM by wapperdude »
Visio 2019 Pro

2020Visio!

  • Jr. Member
  • **
  • Posts: 14
Re: Shape behavior: as you type more text, shape expands downwards
« Reply #2 on: August 24, 2015, 04:06:30 PM »
Super we'll apply these formulas to the shapes, actually pretty straightforward now that I see it but hard to figure out when you're new to Visio. So thank you very much for pointing the way!

The whole shape inheritance model in Visio is still pretty unclear at this point, is there an article somewhere that clarifies this?

Jim

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3822
  • Ideas Visio-lized into solutions
Re: Shape behavior: as you type more text, shape expands downwards
« Reply #3 on: August 24, 2015, 04:44:46 PM »
Not sure what you have in mind re "inheritance".  Take some time to look thru the above referenced links.  In addition to those, this may be helpful.

Shapesheet formula syntax:  https://msdn.microsoft.com/en-us/library/aa200961(office.10).aspx.

VisioGuys blog site has a lot of useful information:  many topics with examples, links, books.

Pretty much it's looking at examples.  Download the SDK, it's free.  Many code examples.  Use the macro recorder. 

Some things to be aware of:
  1)  Any shapesheet cell that is exposed to values input via GUI or manual manipulation will get clobbered, unless guard fcn or perhaps setatref() fcns are used.  Even these can get clobbered by the setf() fcn.

  2)  Shapes with built-in features that use behind the scenes coding, e.g., timeline stuff, are difficult to customize.

HTH
Wapperdude

Visio 2019 Pro