The concept of Structured Diagrams was introduced in Visio 2010 and is featured in many of the templates supplied with Microsoft Visio, and in some third-party solutions, like mine. Connectors, callouts, containers and lists are the key parts of a structured diagrams, and there are times when preventing the deletion of members of a container or list is desirable.[Read more…] about Preventing Deletion of Container Members in Visio
bVisual Blog by David Parker
The concept of Structured Diagrams was introduced in Visio 2010 to provide core functionality for a variety of the templates in Visio, such as the Cross-Functional Flowchart, BPMN Diagram and Wireframe Diagram. This is primarily evident as Containers, Lists and Callouts and they can be customized (see Custom Containers, List and Callouts ), as shown in some of my previous articles ( see https://blog.bvisual.net/?s=container). One example of this extension can be found in all of the flowchart shapes that placed into a swimlane in a cross-functional flowchart. They have a Shape Data row, Function, that automatically inherits the text entered into the header of the swimlane. In another example, a Visio user can use Insert / Diagram Parts / Container to visually group other shapes together, and update the header text of the container. Well, I often do want my custom shapes to inherit the text of a container, so, in this article, I show how the built-in containers can be enhanced to provide this ability.
You should be aware that I often exploit the fact that Visio creates a local copy of each master shape that it uses within a document. This can be modified and set to match master by name on drop, to ensure that it is the one to use, even if the original Microsoft provided version is used. In this case, I use this trick to create hidden, enhanced versions of the containers that are available in the gallery of containers. Microsoft also do this with the Dynamic connector shape in a number of their own templates.
If you examine the Function Shape Data row of any of the flowchart shapes, then you will find the formula:
Update : I have received a corrected response from my friends at Microsoft regarding the use of Spatial Neighbors and Containers, so I have to revise this post from its original. The changes are marked in Red.
The Structured Diagramming API in Visio 2010 is really neat, but there are a couple of problems that I think you should be aware of. The first one is about how shapes can appear to be in a container, but aren’t really; and the second is how the Container type prevents SpatialNeighbors from working … unless you use a new constant.
Let’s start with an example diagram that contains three Process shapes on a Cross Functional Flowchart. Notice that I have select the Process shape labelled A and this has caused the swimlane Function 2 to display a brown highlight … this is a good indication that the Structured Diagramming
API is working, and that Function 2 is a container shape. I have placed two more Process shapes below the swimlanes, and one of them (C) is on top of a SubProcess shape.
… that is the question!
I have known for some time that it is safer to copy and paste code from the web into Notepad or similar, before copying and pasting that into my own code. It is not only new line characters that can be different but also the double-quotes. I recently noticed this when I was writing my series on Visio ShapeSheet Functions A-Z because I make copious use of the EVALTEXT(…) function, so I investigated further and found that there are different double-quotes used when typing text into a Visio shape or typing into a Visio ShapeSheet cell![Read more…] about Two Quote or Not Two Quote …
Developing a Visio solution usually involves both .Net code and Visio ShapeSheet formulas. Good practice dictates that the source code is saved into a code repository, such as Git, where changes can be committed and commented. Visual Studio 2019 now includes native Git support, and can be linked to Azure DevOps easily. The code can be viewed by others and the changes made by commits can be reviewed. This is tried and tested for the .Net code, but any changes made to a Visio template, stencil or drawing document is a black box. If the Visio document is included in the Git project, then all that is visible is the fact that the file has been changed, but the detail of the actual changes are unknown. There may be some comments with the commit, but that is not a precise definition. So, what if there was a way to easily spot the changes?[Read more…] about Viewing Visio Document Changes in Git
Visio was the first non-Microsoft application to include VBA within it back in the mid-nineties. All of the desktop Microsoft Office applications currently include VBA, although Microsoft have been rumoured to want to replace it for many years, and now there is an alternative scripting option becoming available that is suitable for the web too.
Visio was acquired by Microsoft in 2000, and there are still many scenarios when it is useful to have VBA procedures available in Visio for the Desktop. These procedures can be created using the recorder, and then edited, or just created manually. Every Visio document can contain a VBA project, but it must be saved with the .vsdm extension for documents, .vssm extension for stencils, or .vstm extension for templates. The last letter, m, informs Windows that this file could contain macros, as opposed to the normal last letter x, which cannot. Even with this extension, users, or their IT department, may not enable the macros in Visio documents.
The CALLTHIS function in Visio can be used to run a procedure (sub-function) in a Visio Visual Basic document and pass through a reference to the shape that the function is called from. The Microsoft Docs provide an explanation of this useful technique, and it does describe some examples, but it does not show the VBA code that these examples need, nor does it show them working. It also does not make it clear that these procedures do not need to be in the Visio diagram document, but can be in a stencil that is open in the active Visio session. This is important because it means that VBA code can be centralised and distributed for use use on many other documents.[Read more…] about Using the CALLTHIS function in Visio