johnvisiomvp

Life with Visio and other Microsoft Toys!

Archive for the ‘Uncategorized’ Category

Updated Pool Table

leave a comment »

It looks like the original pool table shape had a problem with internationalization. I have updated the shape and the issue has been eliminated.

In the original designed I used lists to control the colour of the cloth. One list was used  to present colour options to the user by displaying names of colours. The second list was a list of the RGB values those colours represented. When the user was presented with the list of colours I would get an index of the colour in that list. I would then use that index to get the RGB value from the RGB list. I had another user cell that contained the RGB value that was retrieved from the RGB list.

The problem appears that though I can place a text string of an RGB value in the foreground colour cell and it worked, but in French, German and Russian* it would be set to black. In the original Visio there were 24 colours numbered from 0 to 23. Later, it was possible to enter any RGB value to get a wide palette of colours. So, when the formula failed it returned a value of zero, which in Visio means black. Testing also showed that entering unquoted RGB values in the Foreground cell in other languages worked. Was it a matter that Visio was applying internationalization rules to colours?

* It is great to have friends who have Visio installed in these languages on their machines.

The workaround I used was to replace the string of RGB values with a list of unquoted RGB values.

I was able to simplify the shape into a single shape with a User cell containing a text string of an RGB value and the Foreground cell pointing to it.

So, if you had this problem with my shape, try downloading an updated version.

Enjoy.

John Marshall… Visio MVP Visio.MVPs.org

Advertisements

Written by johnvisiomvp

August 4, 2017 at 6:50 pm

Posted in Shapes, Uncategorized, Visio

Tagged with ,

Security Badge update

leave a comment »

I have taken another look at the Security Badge Visio shape I uploaded to the Technet Gallery and though it was passable, I could have done better.

The shoulder and the head in the picture  were two separate shapes so they were joined. As Visio Guy is always stressing the fewer shapes or groups, the better. The White bars, the hole and the picture background were all separate shapes and they were replaced by punching holes in the background. A new shape was added behind the shape so that there was a background visible through the holes.

Changing the background of the badge was always tricky if you changed the shape colour, all the sub shape colours also changed. In this new shape colour I “Guard” the black colour of the silhouette.

Minor point, but I changed the bounding box of the shape. I ungrouped the shape and then regrouped all but the metal clip. I then locked the LockCalcWH in the Protection section of the shape before adding the clip to the group.

The original download of the shape was as a stencil, but I have switched it to a drawing. So you just drag and drop to add the shape to your collection. If there were more shapes, I would have left it as a stencil.

So what can the shape be used for? If you are creating a workflow, you can indicate that a certain security level is required or it can be used to indicate that a badge is being created. It can also be used for a Data Graphic, that can be embellish a shape with different colours of security badges to indicate that a certain security level is required. (Go for it JDP)

https://gallery.technet.microsoft.com/Security-Badge-e54a6884?redir=0

Enjoy.

John Marshall… Visio MVP Visio.MVPs.org

Written by johnvisiomvp

July 25, 2017 at 6:49 pm

Posted in Uncategorized

Pool anyone? … or how to create a smart Visio Shape

with one comment

One of the things I like about Visio are smart shapes. The trouble is that most of what is offered as Visio shapes is no more than clipart encapsulated in a Visio shape. For most purposes, that is fine, So time for some real Visio shapes.

A pool table is a good candidate for a smart Visio shape. There are several varieties o table, but they only differ by length and width. So how do create this shape?

Research

The place to start is to do a search on as much information as possible to work out all the dimensions, markings and colours. This will give you an idea of the type of variations that can be handled by a smart shape.

Design

The basic shape may be intimidating with all the finicky details around the pockets, but it is basically two rectangles and size pocket shapes. Okay, two pocket shapes. One for the dise and one for the corners, You basically need to look at it through an artist’s eyes. Paint the background and then paint the pockets on top. The background is basically a brown rectangle to represent the rails and a smaller green rectangle to place on top. No need for trying to fit the cloth around the pockets. The pockets are just painted on top. Think overlays. Rather than try to trim the cloth around the pockets, treat it like a basic rectangle and cover it with the pockets.

Visio shapes are limited in colour and line weights so to get a more varied shape, it will be necessary to group several shapes. Of course, there is over head, so limit the number of shapes and the number of levels of groups to one. The top level (or group shape) should contain all the UI to the user and the sub shapes should use their User sections as an interface to the top level. You could wire the sub shapes directly to the top shape, but is a mess if the shape is ungrouped.  By providing the user cells as an interface, it is easy to restitch if it is ungrouped.  (Of course, I do not always follow my own advice. )

So what makes this shape smart? It has two custom properties, (for now). One controls the table length and the other the colour of the cloth. All tables have a length Width ratio of two to one, so only one dimension is needed. The sizes listed are the ones I was able to find. The lines on the table are based on tables I found and it turns out that there is no formula for the location of the baulk or the D line or the actual radius of the D. The fourty or so cloth colours are based on sales brochures I found, so some of the colours may be pushing the taste of some customers. Of special note, black lines on a black cloth has visibility issues, so the colour of the markings changes to white. A later version may have a custom property to control the line colour. The line colour, width of the bumpers, line position and D radius are all User data cells that can be changed. A User cell is the stay at home cousin of Shape Data, AKA Custom properties. Hidden from the public and less versatile.

Do not forget the accessories. Though the primary reason is to create a shape to represent a pool table in a floor plan, that does not mean you can not use it for other things. With the right accessories, you can use the shape as a training tool setting up possible scenarios and ho to play them. Fodder for the next blog…

 

)for now)

A copy of the Visio drawing is in the Technet Gallery  Pool Table

Enjoy…

John Marshall… Visio MVP Visio.MVPs.org

John Marshall… Visio MVP Visio.MVPs.org

Written by johnvisiomvp

July 24, 2017 at 3:11 am

Posted in Shapes, Uncategorized, Visio

Tagged with ,

Colour My World

leave a comment »

When I was working on the Windows 7&8 phone apps I created a Visio template to help design phone apps. As usually, it was a Visio stencil that was a bit more than dragging and dropping clipart. One of the WP7 and WP8 features it replicated was accent colours that were set on the phone and were applied to the apps. If you changed the Accent colour any object that used the Accent colour would change.
The technique I used was based on a technique demonstrated by Mark Nelson. The original Visio was based on a palette of 24 colours that were enumerated 0 to 24. Mark’s technique used a Lookup formula in the colour cell that looked up the colour in a list. It basically used the list to find the index of the colour.
The instructions are to put this formula in the FillForegnd cell.
=Lookup(Prop.Status,”Black;White;Red;Green;Blue;Yellow”)
Lookup will match the value of the custom property (the old name for Shape Data) Status to the list shown above. The value returned by Lookup will be a number, starting with 0, which corresponds to the position of the matched value in the list. The list shows Visio’s numbering sequence for the first couple of colours. As I said, there were 24 originalcolours, So the list of colour string can be extended to add the missing colours.

If the Status property choices are “Warning”, “Caution” and “Clear”, in the Lookup formula, replace the words “Red”, “Yellow” and “Green” with “Warning”, “Caution” and “Clear”. You must leave the other colours in as place holders to get the correct colour position. Actually, you should keep the list of colours as a comment so that if you want add or change the colours or strings you have a template for their placement. The final formula would be:
=Lookup(Prop.Status,”Black;White;Warning;Clear;Blue;Caution”)

This is fine if the colours you want are in the original 24 colours of the Visio colour palette. Luckily Visio has been extended so in addition to the original colour names you can use a string in the colour cell as long as it evaluates to an RGB value. So now it is a matter of manipulating strings.
In Mark’s solution, everything was within one formula. The string manipulation will require a few more cells. So, what cells and where should they be placed? Most of the strings do not have to be available to the user, so User cells rather than Shape Data cells makes more sense. A Shape Data cell will be required to let the user choose the colour. In Visio there are three shapesheets that can be used. In addition to the shapes’s shapesheet there is a page and a document shapesheet. To reference the document stencil, precede the cell name with TheDoc! And use ThePage! As the prefix for the page. To actually access these shapesheets go to the Developer tab. There is a dropdown for each shapesheet on the ribbon. So why use them? If you have an item that is referenced several times on a page or many times in a document, placing it in the shapesheet with the appropriate scope makes sense. The value is in one location and maintenance is reduced. Do you really want to be hunting through a document to find out where a list is used to change a value? Use a reference and keep a single copy of the value.
So, to solve the limitation on colours, I create two user properties. Both were lists (Type 1 shape data). One list was the names and a the other was a matching list of the RGB values. I could have placed these values in the User Data section for the shape, but I placed them in the User data for the document. So any shape in the document could use these values. The difference between a User property and a shape data property is that the user property is hidden from the user.
I put the reference to an occurrence of the colour in the Page Shapesheet. So the control of the Accent colour is at the page level. So if I change the accent colour, all shapes on that page using an accent colour will change. I chose the page level because I may want to have different accent colours on different pages.
So, the Document shapesheet would have two user data cells:
User.WP7Colours =”Magenta;Purple;Teal;Lime;Brown;Pink;Mango;Blue;Red ;Green”

User.WP7ColoursRGB =”RGB(255,00,151);RGB(162, 00, 255);RGB(00, 171, 169);RGB(140,191, 38);RGB(153, 102,00); RGB(233,113,184);RGB(240, 150, 09);RGB(27, 161, 226);RGB(229, 20, 00);RGB(51, 153, 51)”

Or for the Windows phone 8 accent colours
User.WP8Colours =”Amber;Brown;Cobalt;Crimson;Cyan;Emerald;Green;Indigo;Lime;Magenta;Mauve;Olive; Orange;Pink;Red;Steel;Taupe;Teal;Violet;Yellow”

User.WP8ColoursRGB =”RGB(240,163,10);RGB(130,90,44);RGB(0,80,239);RGB(162,0,37);RGB(27,161,226); RGB(0,138,0);RGB(96,169,23);RGB(106,0,255);RGB(164,196,0);RGB(216,0,115);RGB(118,96,138);RGB(109,135,100); RGB(250,104,0);RGB(244,114,208);RGB(229,20,0);RGB(100,118,135);RGB(135,121,78);RGB(0,171,169);RGB(170,0,255); RGB(227,200,0)”

The Page shapesheet would have one user cell:
User.WP7AccentColour =INDEX(LOOKUP(Prop.WP7AccentColour,TheDoc!User.WP7Colours),TheDoc!User.WP7ColoursRGB)

Or for the Windows phone 8 accent colours
User.WP8AccentColour =INDEX(LOOKUP(Prop.WP8AccentColour,TheDoc!User.WP8Colours),TheDoc!User.WP8ColoursRGB)

And a Shape Data cell :
Prop.WP7AccentColour Type=1
Label = Accent Colour 7
Format =TheDoc!User.WP7Colours
Value =INDEX(5,Prop.WP7AccentColour.Format)
Or
Prop.WP8AccentColour Type=1
Label = Accent Colour 8
Format =TheDoc!User.WP8Colours
Value =INDEX(9,Prop.WP8AccentColour.Format)

In the actual shape shapesheet Fill Format section the FillForegnd cell would be ThePage!User.WP7AccentColour or ThePage!User.WP8AccentColour.

So if you need to add colour palettes to a shape or group of shapes you can create two lists, one for the name of the colour and the other the RGB values. Treating the colour as a string, create a shape data to hold the value and assign that string to the appropriate colour cell. Where you place the user cells or shape data cells is dependent on whether the colour palette is limited to a shape or to a page or a document.
I have added a sample Visio drawing in the Technet Gallery. https://gallery.technet.microsoft.com/Visio-Colour-picker-29158b2c

Enjoy…

John Marshall… Visio MVP Visio.MVPs.org

Written by johnvisiomvp

July 8, 2017 at 6:15 pm

Posted in Shapes, Uncategorized, Visio

Tagged with ,

Who Messed up my bed?

leave a comment »

One of the things I love about Visio is smart shapes. Unfortunately, there are a lot of Visio shapes that are not smart. Including a number of shape collections from Microsoft that are just basic shapes. This is not the Visio team’s fault because Microsoft is a large company and not everyone really understands what a real Visio shape is. It is very easy to create a Visio shape, it is just a matter of dragging an image to a Visio page and Visio will wrap a Visio shape around the image. At this point, this new Visio shape acts like any other Visio shape and can be embellished with connection points and shape data. For most purposes, this is enough.
Real Visio shapes have smarts.
Formulas … The cells within a Geometry Section can contain formulas that react to stretching the shape. The arrow head was an early example of this. No matter how the shape was stretched, the arrowhead point remained at 45 degrees.
NoShow … The Geometry section had a NoShow cell that controlled the visibility of that specific Geometry section. The flowchart shape was an early example. The shape contained a Geometry section for each of the flowchart shapes. Which flowchart shape was visible was dependant on the value in Shape Data Section (formerly Custom Properties). This made it easy to switch, but it meant that the drawing contained redundant information that was not visible and made the drawing larger.
Inter Shape references … One of the powers of grouped shapes is that a shape can refer to a different shape. When you group shapes, you can have the subshape reference a value in the top (group) shape. The downside is that if you ungroup, the references are destroyed.

So what does this have to do with beds? Well, one of my favourite examples of a smart Visio shape was the bed. Unfortunately, in 2013, it got messed up. It was “fixed” in 2016, but it lost some of its’ Visio smarts. Rather than one shape controlled by shape data it is now several shapes, King, Queen, Standard. The bed was a great example of a Visio shape. It was basically a rectangle with rounded corners and the only difference was the length and width. Which would be boring, but it used Visio smarts to have a blanket, turned down sheets and pillow(s).
Before I tried to figure out what was wrong with the shape I decided to find out if those were the only three sizes. I came up with forty sizes including, Bunk bed, California King, California Queen, Crib, Double/Full, Double/Full extra long, Eastern King, Euro King 200, Grand King, Half Queen/Split Queen, King, King Single, Long Single, Olympic/Expanded Queen, Queen, Queen RV, Single extra long, Small Double, Small Single, Split California King, Split Eastern King, Split Euro King 100, Split Euro King 90, Standard, Super King, Super Size Queen, Three Quarter, Twin/Single, Twin/Single extra long, Western King and Youth. Some of the sizes had multiple dimensions.
So, what was wrong with the shape? Other than being a bit more complex that it should, someone in attempting to modify the shape added an extra shape to the main group. I was able to delete this extra shape and the main shape returned to its’ original functioning.
So, how should the shape have been created? A basic Visio shape is limited to one colour, so there should have been a separate shape for the various areas that could have different colours, the pillows, blankets and sheets. In the original bed shape, it seems that it contains two grouped shapes, one for one pillow and one for two pillow. Each group seemed to consist of a pillow, blanket and sheet shape. I did not examine it closely, but that is how it appears. In which case, that would be over kill. I also prefer grouped shapes to use their User sections as an interface to other shapes in the group, so if the group is ungrouped, the formulas are not destroyed and the references in the User cells can be reestablished. I would also replace the use of theme colours with user chosen colours for blanket, sheet and pillows. Using a right click to select the size rather than Shape Data would also be a nice touch.

At some point, I will update the original shape to include right click behaviour and colour selection and post them in the Visio gallery.

So what other shapes are similar, but only differ in overall dimensions? Pool tables! As far as I can find out, there are only four or five sizes. The edges are a standard width and the holes are a standard size. So a pool table would be an ideal candidate for a Visio smart shape. Colour schemes are easy too, green cloth and black rails.

Enjoy…

John Marshall… Visio MVP Visio.MVPs.org

Written by johnvisiomvp

March 22, 2017 at 8:54 pm

Posted in Shapes, Uncategorized

Tagged with ,

Visio – Rip out the ShapeSheet!

leave a comment »

The Visio Shapesheet has been a core part of Visio almost from the beginning. Though, over the years, it has undergone some revisions to handle new cells, it is basically unchanged. Now, it is long overdue for a major overhaul.
(and give shape developers some love)
To line up with the Office 365, Visio will need an online version. So that would mean writing two changes, a desktop and a online version.
So, I would suggest ripping the shapesheet out of the desktop version and make it a standalone app. When working on the shapesheet the focus is inwards toward the shape, so a standalone application would be sufficient. As a standalone app, it would not have to be redone for the online version of Visio.
Since the new file format uses XML, it should be relatively easy for the standalone app to extract a shape from a file to work on.
I can see several ways the shapesheeet can be enhanced.
The AutoCAD converter creates terrible shapes, I have had a few that have ended up being more than a thousand Geometry shapes with hundreds of rows and totally unworkable. It is not the conversion’s fault, it is basically gIgO. AutoCAD users have different criteria than Visio users. What is needed is a good set of tools.
Like…

  • Sorting? Not necessarily sorting, but the developer should be able to change the order of the rows in the shape data, user data and connection sections. Rather than using a menu item, an up/down toggle button would be preferred. Using a menu item, is not a big deal, but do it a hundred times and it becomes tedious.
  • In addition to rows, Geometry sections should also be able to be reordered, so that one section ends at the point the next section starts. Which would allow …
  • Join two sections. If the order of the Geometry sections can be changed, joining adjacent Geometry sections should be relatively easy. Each Geometry section has a start and end point, so joining would mean there would be a common end and start row in the middle of the new section.
  • Of course, not all Geometry sections have a convenient start and end point. So it would be useful to be able to reverse a Geometry Section so the section ends where the adjacent section starts.
  • A preview window so you can see what the shapesheet generates. This can be down with the drawing page, but you have to switch windows to change focus. A dedicated preview window would keep up with where the designer is in the shapesheet and keep the preview focused.
  • Remove the shapesheet window from within the Visio window, so it can be moved to a separate monitor. Actually being able to tear any window off and place it outside the window on a separate monitor would be useful.
  • Highlight the current geometry section in the preview window. Use a gradient so the direction of the geometry section is obvious. Let the designer have an idea of where the geometry section starts and where it ends. As before, keep the content of the preview window centered on the current work.
  • Allow the user to set the highlight colours.
  • A few versions back, Visio added relative positioning in the Geometry section. Another useful feature would be a toggle button to switch between absolute to relative.Sometimes it is easier to enter absolute positions, other times it is easier to use relative. Currently we can use a menu item, but that involves selecting the Change Item type and remembering the appropriate alternate type.
  • Add a command to turn a shape with many geometry sections into individual shapes.
  • Add a command to split a Geometry sections in two, based on what row is selected.
  • Replace Shot gun editing with fully automatic editing. Shot gun editing should remain, but full auto will speed up repetitive editing. What am I talking about? To delete a row, you have to select the right click menu and then choose delete row. It is like pumping a shot gun before pulling the trigger. Once or twice, not bad, but when you have to delete hundreds of rows it gets tedious. Being able to click a button is faster, being able to hold down the button and continuously delete is even faster. (and very dangerous)
  • An alternate to the bounding box is needed. Rather than just a box, the shape involved should change color. The bounding box just shows that something in that area was selected.
  • A bonus would be to use gradient colors that show the direction of lines.
  • One of the first things that bites first time shape developers is the ungroup command. For some applications Group and Ungroup are complements and you can ungroup and then group to get back to where you were. In most cases this is true, but with Visio, grouping creates a new shape to control the other shapes and ungroup deletes that shape. This group shape, like any other shape can be enhanced, but ungrouping will also remove these enhancements. So, if you add user data, shape data, actions or connection points, these will be lost. Another nicety for shape developers would be the ability to copy these sections from other shapes. So, never ungroup should be the rule? No, during shape development, grouping and ungrouping is a very useful tool. You can align a set of shapes on their centers, group them and then align or distribute this group with other shapes/groups without destroying the group on center the shapes have in the original group.
  • If the shapesheet is like a spreadsheet, why can we not copy and paste cells, rows and sections between shapesheets like Excel? What about copying from a shapesheet to Excel and back.
  • When you are working on a Geometry section, the row you are working on is highlighted in the drawing to let the designer know where that point is. Also for reference, if the PinX or PinY cells are selected, a cross should be placed over that point so the designer can see where the point is.
  • So, where do these new buttons go? When the shapesheet is open, a dialog box with edit buttons should open for the full session. Far faster than using right click events.
  • The dialog should have hooks for third party developers.
  • Make the points on the pencil tool more visible. Currently they disappear as the scale gets bigger. A small blue dot buried inside a black line is tricky to see, let alone be able to determine if it is a dot or shape.
  • There should be a tool to select a connection point and nudge it. The current Connection tool is not the easiest way to correctly place a Connection Point. There is also no way to easily move the Connection Point.

I know that the shapesheet is not just about the shape, but it could be about the page or the doc, but these last two cases can be easily addressed. Of course, these shapesheets shoud receive a similar upgrade.
Outside the Shapsheet
Of course, before even getting into the shapesheet, the ability to sort the shapes in the stencil would be very useful. Yes, this can be done with VBA, but this should be a standard feature.
Add an option to the UnGroup command to preserve the shape that was created by the Group command, but free the sub shapes from their servitude to it. Later on, the shape can be converted to a group and the sub shapes re-added to the group.
Universal Shapes
While we are at it, the team should be working with the other Office teams to create a standardized shape and how it is handled. Word, Excel, PowerPoint and Publisher have their own shapes, MSOshapes and can easily transfer between each other, but Visio has its’ own way. You can copy one of these diagrams into Visio and all is fine, but it has lost all its’ smarts and is just a collection of objects. Even what was a red text block in Word or Excel goes from a single object to multiple objects, one for the text, one for the red background and another for the border. They also have WordArt. This is not a new suggestion, we have discussed it at previous summits in the early 2000s.

John Marshall… Visio MVP Visio.MVPs.org

Written by johnvisiomvp

August 5, 2016 at 7:03 pm

Posted in Uncategorized

Visio – Making a point

leave a comment »

Visio does have a tool for adding Connection points, but it does not have a tool for nudging that point if you missed the first time or decided at a later date you anted it elsewhere. Normally, Visio Connection points are simple, middle of the shape, one of the corners or the center of one of the sides. Once you get into creating Visio shapes, the Connection point can be anywhere.

In my current project, I am dealing with shapes that connect to tubing. On the surface, this seems like a simple task. The connection point should be centered on the tube. Unfortunately, to create the shape involves a lot of unioning joining and other operations. I could leave the shape as a collection of basic shapes so the tube connection stands out, but that would mean a complex shape with poor performance.

In the Connection sections, the Connection points are positioned at a percentage of the Width and a percentage of the Height. So, simply playing with the scaling factor is a hit and miss operation. The movement by tenth of an inch may have radically different scaling factors for different shapes. Basically, a lot of playing to get it right.

My solution is to create a new shape that when dropped on the shape that needs adjustment would expand to the height and Width of that shape and display a control handle with a bullseye. You can then use the control handle to position the bullseye to the location of the Connection point. At the same time as you are doing this, the shapesheet for the shape is open in a different Visio session at the Connection section. Next to the bullseye would be the scaling factors for that position. So, it would be a simple matter of copying the values to Connection points in the other spreadsheet.

I have created this Connection tool and will be publishing it next week to the Visio Gallery.
John Marshall… Visio MVP Visio.MVPs.org

Written by johnvisiomvp

August 3, 2016 at 8:51 am

Posted in Uncategorized, Visio

Tagged with