LayerManager for Microsoft Visio layer sets can now be called from external code and are also available from a sub-menu of the Layer Buttons drop-down ribbon button. The Layer Manager window does not need to be open to use the sub-menu because it detects the Layer Set buttons on the page.
LayerManager includes the following useful actions that can be called by your own code, such as VBA macros or C#.
Parameter | Description |
ApplyShapeLayerSet.<layer set name> | Applies the named layer set to the page, if the named Layer Set Button exists on the active page |
ApplyShapeLayerSetToDocument.<layer set name> | Applies the named layer set to all the pages, if the named Layer Set Button exists on the active page |
SwapEnds | Reverses the direction of all selected 1D shapes |
MatchHeights | Makes all secondary selected 2D shapes to be the same height as the primary selected 2D shape |
MatchWidths | Makes all secondary selected 2D shapes to be the same width as the primary selected 2D shape |
MatchWidthsAndHeights | Makes all secondary selected 2D shapes to be the same wideth and height as the primary selected 2D shape |
They simply need to be called with the Visio Application.QueueMarkerEvent(contextString), where the contextString is “bvLayerManager.<parameter>”
VBA example to apply the “Space Usage” layer set to the active page:
Application.QueueMarkerEvent "bVLayerManager.ApplyShapeLayerSet.Space Usage"
Related posts
The importance of #layers in Visio for Power BI
Judging by the number of downloads of my free Visio and Power BI GuIde, there is an increasing recognition of this great feature. I recently started to prepare an example for someone, but found that their sample Visio document has just over the 1,000 shape limit, so what can you do about that? The answer…
Navigate to named areas in Visio with SS Plus
Many years ago, when I was an architect, I used a Unix CAD system with large buildings. I was able to navigate quickly to rectangular areas that I had named. Well, the Export to PowerPoint feature in Visio Plan 2 provides Slide Snippets, which are named areas that can be exported to PowerPoint. My SS…
Update to LayerManager add-in for non-English users
A French user of LayerManager recently reported that the Refresh Counts button was not working for him, and a few other users were recently finding that the trial period was reporting expired immediately after download. Both of these issues have hopefully been addressed in the latest version 23.3.1, which is available for free to current…
Editing Visio Layer Colours with LayerManager
Desktop Visio has a tremendous ability to assign shapes to none, one or more layers, and the efficient use of them can make a drawing so powerful by toggling layers visibility or locking certain layers whilst working on other layers. The same drawing can be used, displayed or printed for many different purposes just by…
Fixing the sub-shape layer assignments of Visio shapes
I was preparing a new update of my Layer Manager tool, and was constantly coming across a lack of quality control in the sub-shape layer assignment in a number of the master shapes in Microsoft provided stencils. I have mentioned this to Microsoft as a bug before but the problem still persists in Visio for…
Developer Mode for advanced Layer Manager actions
I have had more than one person ask me how to see the full Layer Manager panel, so I must have not made it clear enough in the help file. Visio has a Developer Mode that is simple to switch on, and provides some extra functionality, including a Developer tab in the ribbon. Layer Manager…
Leave a Reply