Site icon bVisual

Layer Set menu options and calls from code added to LayerManager

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#.

ParameterDescription
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
SwapEndsReverses the direction of all selected 1D shapes
MatchHeightsMakes all secondary selected 2D shapes to be the same height as the primary selected 2D shape
MatchWidthsMakes all secondary selected 2D shapes to be the same width as the primary selected 2D shape
MatchWidthsAndHeightsMakes 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

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…

Assigning Visio Shapes to Layers from Excel Table

I work a lot with layers in Visio, and written an add-in, LayerManager, to assist, but I was asked an interesting question recently: How can shapes by assigned to layers automatically from a list in Excel? So, I thought I would present my solution. This particular request was for a Timeline diagram, where the Milestone…

Exit mobile version