Question about multiple text fields/labels for shapesheet ninjas ;)

Started by Visisthebest, June 09, 2020, 10:33:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

In this really interesting article by Visio expert John Goldsmith:
https://visualsignals.typepad.co.uk/vislog/2020/03/creating-a-visio-shape-with-an-expanding-row-count.html#more

talking about multiple text fields/labels he describes this option:

"If the number of instances is a concern then you could possibly opt for generating new geometry sections rather than sub-shapes"

In diagrams with several hundred shapes that already have several subshapes, I worry about adding 10+ subshapes on each shape to add text labels and the diagram becoming sluggish if not too slow for a good user experience.

I do really like this design with a table that holds the text labels (but do not need the number column), see picture from John's article attached.

How could this be achieved with geometry sections to avoid adding thousands of subshapes?

(hundreds of shapes that each get more than 10 additional subshapes would add up to thousands of shapes total, which I fear will undermine the user experience because I understand Visio slows down considerably with thousands of shapes on a page)

Thank you for your ideas and guidance!

By the way, I don't mind if these text labels are static text that I set with VBA on the shape, shape data that can be updated via an odbc connection is a nice bonus but not a must.
Visio 2021 Professional

wapperdude

A solution is possible... and without using VBA!  But, it's a bit of a pain.  I wouldn't recommend doing this.

1) Text entry is via ShapeData.
2) Regular text entry is locked and not allowed.  This would really mess with things and break the shape.
3) Getting the text centered in the faux boxes is by trial and error.  There is only one text "box" in this approach.  Multiple geometries do not create multiple text boxes.  Just one, that's it.  So, text size, spacing, and shape size are all inter-related.  There's probably some scaling formulas that might be used, but that was beyond the scope of this example.
4) In order to achieve separate "text rows", Insert > Field > custom formula was used.  Because the Text is locked from editing, either unlock it, or, open shapesheet and edit Font.
5) Position of the control reveals / hides text by setting it to transparent, and changing the hide geometry between true and false.

The example only does 3 total rows.  The 1st row is always visible.
Visio 2019 Pro

Visisthebest

Thank you Wapperdude the example works well, for me the text in the various boxes can all be the same font size etc but sometimes be two or three lines long, so I guess that will require a more complex way to set the box sizes.

Good to know you wouldn't recommend this approach (and it is clear why) but it does provide a solution with some limitations when performance becomes a real problem. It is very good to know this IS possible!
Visio 2021 Professional

wapperdude

Well my interest is piqued.  So, here's updated example with extended formatting that makes text adjustments more flexible.
Visio 2019 Pro

Visisthebest

Wow impressive work and very nice that this way boxes with multi-line text can be added as well! :)
Visio 2021 Professional