Skip to content
  • Home
  • Work
  • About
  • Blog
  • Contact

Making use of master inheritance in Visio

John Goldsmith's profile image

John Goldsmith

28 November 2013
  • ShapeSheet

MasterInheritanceInVisio

Sometimes, when designing a shape in Visio, you want to allow a user to make changes to your shape such as color, size or position, but also have some mechanism for returning the shape to a default state.  In this post I’m going a explore a method that works with Visio’s master inheritance functionality.

Inheritance

As you know, when you drag a master onto the page, most of the resulting instance shape’s cells will inherit their formulae and values from that master.  You can see that reflected in the ShapeSheet where black cell text represents an inherited formula or value and blue text a local (to the shape instance) version.  For most shapes Visio will write a local value into the PinX and PinY cells as the shape is dropped:

InheritedAndLocalValues

Other cells will only become local when a change occurs in the instance, such as when the user applies a fill color to the shape.   

In general, the benefits of inheritance are improved performance, reduced memory usage and a smaller file size (something that Visio 2013 does an even better job of).

A standard approach

Let’s look at an example of a fairly standard approach to resetting a shape’s fill color.  Here you could add an Actions row and use a SETF function to fire the default formula or value into your target cell (FillForegnd in this case):

StandardReset

The only problem here is that we’ve still ended up with a non-inherited cell value – i.e. it’s local.

Have a look at the steps:

  • as the shape was first dropped FillForegnd inherited its formula and value from the same cell in the master.
  • when the user then applied their own fill color, via the UI, the cell value became local. 
  • hitting our reset, as above, only resets the FillForegnd value to be the same as the value in the master but not directly inherited.

Resetting inheritance

The alternative is, rather than use the SETF function to set the local formula, use SETF to reset the cell’s inheritance by firing in an “=” instead. 

Setting a cell’s formula to “=”, whether entering it manually in the ShapeSheet, using SETF or via code tells Visio to re-inherit the cell formula.

So you can now lose the User.DefaultColor cell and just keep your default color value in the master’s FillForegnd cell:

InheritanceReset

You can, of course, apply this to any other cells you like.  In the  accompanying sample Visio document and image below is an example that allows the user to set custom fill colors on each of the satellite sub-shapes and change their relative positions – all backed by master inheritance, to reset to default values.

ResetSatellites
Microsoft MVP Logo

John has been a Microsoft MVP, in the award categories of Visio and M365, since 2008.

Visio Blogs

  • Bill Morein (via Wayback Machine)
  • Chris Castillo (via Wayback Machine)
  • Chris Hopkins (via Wayback Machine)
  • David Parker
  • Eric Rockey
  • Jesse Phillips-Mead
  • John Marshall
  • Michel LAPLANE (FR)
  • Nikolay Belyh
  • Saveen Reddy (via Wayback Machine)
  • Visio Guy
  • Visio [Product] Blog
  • Visio Insights (via Wayback Machine)

Visio Resources

  • Developing Microsoft Visio Solutions
  • Visio Stencils at ShapeSource
  • Microsoft Visio YouTube Playlist
  • Visio (Product site)
  • Office 2010 Engineering
  • Visio 2016 SDK (Download)
  • Visio JavaScript API reference
  • VisioMVPs.org
Contact

visualSignals ltd
31 Riverview Grove
London, W4 3QL
United Kingdom

+44 (0) 208 078 9120

Around the Web

Copyright © visualSignals ltd 2025

Mastodon