Have set of "auto-height box" shapes autosize to max height of set

Started by kbgeoff, February 01, 2017, 03:25:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kbgeoff

Howdy, Visio enthusiasts.

I've got an idea for making a master shape for a network diagram which consists of various text boxes.  This master shape represents a network device which has various interfaces with each interface having 5 properties.  The properties are: Interface, IP Address, Name, Gateway For, and Routes.  In my brainstorming for this master shape I've come up with some "requirements" of how I'd like it to behave.
  • The master shape is basically a table containing five columns: a header row (included once at the top of each master shape) and a row for each interface on this network device.  Just like in other MS products, the height of a row is dictated by the "tallest" cell in that row.  In most instances of this master shape, the right-most cell (the "Routes" column) will have the most data (and thus be the "tallest" cell)
  • While the width of each column is static, I'd like each of the cells to behave like the "Auto-height box" shape so the more data in the cell, the taller the cell is
  • I'd like a connector on the left side of the row and a connector on the right side of the row.  A little way down from the top but set to an absolute Y value and not something like =Height/2.  I'd like the 2 individual connectors on each row to be the only place that accepts a connector (i.e. cannot connect to the "entire" shape)

Starting with a row of "Auto-height box" shapes, I was able to do the "easy" things...
  • Getting the cells on one row the right width
  • Deleting extra connectors on cells
  • Setting left and right connectors "=Height-1/8in"

I just figured out how to get shape to only expand "downward" (LocPinX = GUARD(0), LogPinY = GUARD(Height)) so I am going to work on getting the cells in the following row to "stick" to the bottom of the previous row's cell.

However, I couldn't figure out how to get each row of cells to match the height of the tallest one.  The first cell was easy enough... I named the cells/shapes for the first row as Interface1, IPAddress1, Name1, GatewayFor1, Routes1 and had the Height for the first cell (Interface1) set to "=GUARD(MAX(Scratch.B1*Scratch.X1,IPAddress1!Height,Name1!Height,GatewayFor1!Height,Routes1!Height))".  It seemed to work great when I put multiple lines of text into the cell Routes1 (aside from the shape expanding both up and down).  However, when I tried to copy the formula "=GUARD(MAX(Interface1!Height,Scratch.B1*Scratch.X1,Name1!Height,GatewayFor1!Height,Routes1!Height))" into the second cell (IPAddress1) it complained about a circular reference.  In hindsight, the error makes complete sense but I'm having a hard time grasping how to get around it.  While the "Routes" cell is typically the tallest cell, that's not always the case, thus my thought of having it determine the max height of the row's cells

Since I'm not expecting much "dynamic-ness" from the shapes, I'm fully expecting to need to do a lot of manual work and create separate "master" shapes for the varying number of rows.

Any help or tips that anyone is able to lend on getting the heights to match up would be greatly appreciated.  Also, please let me know if I'm not describing things well and I'm happy to attach a screenshot or my test drawing to better illustrate what I'm doing.

Thanks much!

Yacine

Please upload your shape.

Not sure if this post can help: http://visguy.com/vgforum/index.php?topic=6914.msg28863#msg28863
Yacine

kbgeoff

I've attached a vsd and vsdx version of my work in progress.

There are four rows in the table for data and some extra ones below that I was working on inputting all the ShapeSheet stuff.

Like I mentioned in my first post, I'm having a problem dynamically setting the height of the cells in a row to be the tallest content.  In my samples, I'm setting the height of each row's cells to that row's Routes cell.  However, if you add more content to one of the other cells (thus making the cell taller than that row's Routes cell) it does not increase in height.

I was able to hamfist the text box location on almost all the cells but, for some reason, the "Routes" text boxes are a little bit lower than the other text boxes.

I also haven't done any research into how to prevent Visio from using the entire text box as a connection point... I would prefer that only the connection points on the left side of Interface and right side of Routes be allowed connections.

Yacine

The key is to separate the calculation of the height from the actual assignment.

I had a try with the tool I recommended in the previous post. Have a look.
Yacine

kbgeoff

Thanks for the help, Yacine!

The table you developed looks very much like what I'm trying to get.  I need to look into SHAREM more to figure out how to use it with my table.  I hope to have time in a couple days while I'm traveling.

Thanks again!

wapperdude

Here's an alternative approach, does everything within the shapesheet. 

It makes the Interface shape the cornerstone shape as far as row characteristics are concerned.  The row fill color, the font, the horizontal and vertical alignments are all based on the Interface shape.  Row placement on the page is a function of the Interface shape placement.  Stacking of rows occurs by use of gluing.
 
Each row shape retains it's own width and height characteristics.  The shape widths, as provided, are hard coded.  This forces all rows to have nice, consistent alignment.  The Txtwidth formula is set such that fixed width is maintained, but, text wraps and centers nicely.

Row height is based upon the greatest height of any shape within the row.

Entering the data is not addressed in this example.

Enjoy.
Wapperdude
 
Visio 2019 Pro

Yacine

@Wapperdude,
my solution is also based on pure shapesheet work. The difference is in the way of setting it up. The tool allows to manipulate the shapesheets from an interface and the work done once is not lost.
Yacine

wapperdude

@Yacine:  sorry, I see how my wording might imply that your solution wasn't shapesheet based.  Wasn't the intent. 

Wapperdude
Visio 2019 Pro

wapperdude

Decided to add an alternative to the alternative, namely, provide "easy" shapewidth changing.  There is a caveat.  To universally apply to all shapes in a given column, both existing and future additions, it is necessary to have a global reference to avoid using a macro.  Thus, the page shapesheet has ShapeData entries added.  One for each column.  These entries are manually added to the shapesheet.  Then, right clicking a shape, accesses the placeholder for that shape's global setting and "flushes" the change to all shapes in that column.  New shapes, added by copy paste of the Interface shape automatically inherit the setting.  Without the page entries, this new alternative doesn't work.

Wapperdude
Visio 2019 Pro

kbgeoff

Thank you so much, Yacine and wapperguy!

I'm heading out of town tomorrow morning so I hope to have some uninterrupted time over the next few days to review and absorb the solutions.

Thanks again!