The desktop Visio editions, Visio Professional and Visio Plan 2, have a great way of automatically displaying data as Data Bars, Icon Sets, Text Callouts and Color by Value. The first three types of Data Graphics require sub-shapes to be inserted into each shape that they are applied to, but the last one, Color by Value (CBV), merely requires some User-defined Cells and formulas. However, unlike the first three, there can be only one Shape Data value displayed as colours in each Data Graphic (DG). So, how can we easily update the colour assigned to each value using code, rather than manually using the manual dialogs provided?
[Read more…] about Understanding Visio Data Graphic’s Color by ValueShapeSheet
Setting Theme defaults in Visio
I was recently asked how to change the default font size and line weight in Visio, and then saw then many others are asking the same sort of question. I found one reasonable answer suggesting that you should create a new document from your required template, then edit the Styles to suit, and then save as a new personal template. Well, I am not sure I like that answer because it means you must create a duplicate template for each one you use. So, I decided to see if I could find a better way…
Firstly, it is important to know that these default settings are not editable for the whole Visio application, because they are stored in each document, under the Styles collection. You can view the Styles in a document using the Drawing Explorer window that can be opened from the Developer tab.

Making Custom Shapes for Visio for M365
I recently revised my chess and checkerboard Visio documents to work in Visio for the Web (Visio Plan 1), but now that Microsoft are providing a version of Visio free to M365 business users, I need to make some further adjustment to get them to work for these users who do not have a Visio Plan 1 or Plan 2 license. The problem is that Microsoft restricts the capabilities of the free version by white-listing Visio masters. So, the answer is to delete the masters … then the Visio document becomes editable in Visio for M365!

So, what is the downside?
[Read more…] about Making Custom Shapes for Visio for M365Understanding Morse Clicks with Visio
A few years ago, I wrote an article about messaging and encryption inspired by a visit to the National Museum of Computing in the UK. I developed a Morse Click shape to demonstrate how Visio can be used to represent and learn Morse Code. However, I never published the shapes here, and my good friend John Marshall recently wrote an article about Braille in Visio, so I thought I should explain how I made the Morse Click shapes, and I took the opportunity to enhance the shapes with some accessibility features that I have learnt since I originally designed them. I have also changed the shapes to be Visio Web friendly, which means, for example, removing shape effects.
I think I learnt Morse Code as a Cub Scout, but forgotten it in the half-century since. Its evolution, and its use today still makes very interesting reading. Each letter comprises of between one and four short or long clicks, whilst each number has five such clicks. Generally, the most used letters have lesser clicks, with ET being the lowest number, presumably to save an extra terrestrial money on a phone call home!
There are just two master shapes of interest here, Morse Click and Morse Click Rack, and a couple of page Shape Data rows. The Morse Click shape can be anyone of the 36 characters with a simple Shape Data value change, whilst the Morse Click Rack is a list shape and can spell out the words of up to 26 Morse Click shapes within it.
[Read more…] about Understanding Morse Clicks with VisioUsing a formula for Shape Data labels prevents multiple updates
I have only been developing Visio solutions for 25 years, but I got a surprise this week when I was trying to understand why I couldn’t update the value of a Shape Data row of multiple selected shapes. It is something that I often do, so it took me a while to understand why I was failing to change the values, even though it appeared to initially change in the Shape Data window. There was no problem selecting the shapes individually, but every time I selected multiple shapes and edited these particular rows, I could see the new value in the Shape Data window, but as soon as I looked at the individual shapes, I could see that the values never got changed. I checked my code in vain, and ran the Events Monitor from the Visio SDK. Visio seemed to enter the Shape Data scope, but then immediately exited it without attempting to apply the new value to the shapes. Very strange!

Automatic Line and Segment Lengths in Visio
Many years ago, I wrote some VBA code to calculate the length of a multi-segment line in Visio, see Automating Area and Perimeter Length Shape Data , but Microsoft have since provided a handy ShapeSheet function, PATHLENGTH(…), to do the same without any VBA. The function is described on one of the pages in Visio ShapeSheet Functions O-R , but here is one way that it can be incorporated into a useful shape for, say, cabling or piping, and thus be available in Shape Reports. Moreover, the Shape Data can display the length of each of the segments in the line, in addition to the total length.
