Everyone knows that you can change the colour of Visio shapes. Most people know that you can also change the fill pattern too.
Shape Design
Automating Area and Perimeter Length Shape Data
[UPDATE: Microsoft introduced a new function into Visio 2010 called PATHLENGTH(…), so some of the following is now not required. See Automatic Line and Segment Lengths in Visio )
Another newsgroup question has asked about automating the update of shape area and perimeter lengths. Now, this is an area (no pun intended) that I am most interested in because I used to do a lot of space planning. Visio Professional does include Space and Boundary shapes on the Resources stencil that use an add-in to update the area, but does nothing about the perimeter length. These shapes do highlight some of the issues to be considered though…
- Visio pages can be scaled, and indeed the various floor plan and site layout templates in Visio are pre-scaled. Most templates are not scaled, and therefore default to 1:1 scale.
- Visio measures everything internally in inches, although you can display in almost whatever units you choose.
- The Visio Application object has a handy ConvertResult (StringOrNumber, UnitsIn, UnitsOut) method, which can be used for linear and area measurements … and can also be used for date and times.
- Visio can store decimal numbers to a very high degree of precision (I counted 14 decimal places), but you almost always want to format the display.
- Visio can call a method in a VBA project when the values in specified cells are changed.
- It is easy to display Shape Data in a shape, either by using Data Graphics or by Insert Field
[Read more…] about Automating Area and Perimeter Length Shape Data
Writing rules to validate diagrams in Visio 2010 – A worked example
Microsoft Visio 2010 Premium Edition introduced an extension to the Visio Type Library called the Validation API. This provides the capability to validate a Visio diagram to ensure that its construction complies with industry-standard or company –wide rules.
Organizations are able to use this new feature to encapsulate business logic as validation rules, grouped within rule sets.
Microsoft Visio 2010 Premium edition contains rule sets for use with Basic and Cross-Functional Flowcharts, BPMN Diagrams and SharePoint Workflow Designer diagrams.
This article describes how you can create your own rule sets and rules.
Visio 2010 Developer References
By now, some of you will have downloaded the Visio 2010 Beta, and may even have downloaded the Visio Automation Reference and ShapeSheet Reference files. You may the, like me, wondered how to actually view the contents of these two hxs files? Well, fortunately, Stephanie Horn from the Visio team at Microsoft as able to help, so I thought that I would pass it on to you. (Remember these files are still beta, but they do contain some useful information).
Once you download and unpack the files, you will end up with two files called Visio2010AutoRef.hxs and Visio2010ShapeSheetRef.hxs. You can view them with any HxS viewer, but the download site suggests replacing the existing versions of these files and viewing them through Visio help. To do this:
1. Rename the files VISIO.DEV.HXS and VISIO.SHAPESHEET.HXS, respectively, and put them in your Office141033 directory (i.e., C:Program FilesMicrosoft OfficeOffice141033).
2. Open Visio, and launched help (F1).
3. Pick “Developer Reference” or “Visio ShapeSheet Help” in the Search pull-down menu.
I suggest turning on “Show Table of Contents” using the book icon in the toolbar, so you can navigate through the help topics.
Visio 2010 Validation Rules (part 2)
In my previous post, I began to explore the new Validation objects in the Visio 2010 Technical Preview, an I used some VBA code to do this. Well, I have now uploaded the code to OneDrive ( bVisualValidationExplorer.vss ), so that you can use it too! So, this post is about using this code …
First, download the stencil and save it to you My Shapes folder (if you trust me). This will make it available to you to use in any Visio 2010 document.
Then, whenever you want to use the code, simply open the stencil from the More Shapes / My Shapes category….
The stencil will be docked with the other shape stencils, but, of course, this stencil does not have any shapes … only VBA code.
Visio 2010 Validation Rules (part 1)
The Microsoft Visio team recently blogged about Creating custom validation rules for Visio 2010 , in which it was suggested that we can use Visual Basic for Applications to interact with the new validation API. I thought, there’s a challenge … so I will develop a VBA project to do just that. I will upload the code soon, but, as it is only half developed today, I will demonstrate how to understand why a rule has been broken.
In the following BPMN diagram, I have failed to connect a Task to the End Event. I have made it obvious here but it could be easy to overlook in a larger diagram. In fact, I know of one company who were advised by a “consultant” that there must be something wrong when the end of a connector goes red therefore you should move it away from the shape until it goes green! The result was that the company had over 300 flow diagrams without a single valid connection! That company is no more!
[Read more…] about Visio 2010 Validation Rules (part 1)

