Quand vous avez dans plan Visio avec beaucoup de connections, cela devient très vite non lisible.
Voici comment créer des macros sous Visio pour exploiter au maximum vos calques.
Commençons par gérer nos calques.




Activer le mode développeur.




(Name) : BlueCheckBox
Caption : Bleu ON
Value : True








Modifier le code comme ci dessous:
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  | 
						Sub Layer<em><strong>Toggle(ItemNbr As Integer, OnOff As String)</strong></em>     'Enable diagram services     Dim DiagramServices As Integer     DiagramServices = ActiveDocument.DiagramServicesEnabled     ActiveDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150     Dim UndoScopeID1 As Long     UndoScopeID1 = Application.BeginUndoScope("Propriétés des calques")     Dim vsoLayer1 As Visio.Layer     Set vsoLayer1 = Application.ActiveWindow.Page.Layers.Item(<em><strong>ItemNbr</strong></em>)     vsoLayer1.CellsC(visLayerVisible).FormulaU = <em><strong>OnOff</strong></em>     Application.EndUndoScope UndoScopeID1, True     'Restore diagram services     ActiveDocument.DiagramServicesEnabled = DiagramServices End Sub  | 
					

Ajouter le code suivant dans vos sections :
| 
					 1 2 3 4 5 6 7  | 
						If Non_de_la_checkbox_CheckBox Then     Call LayerToggle(1, 1)     Non_de_la_checkbox_CheckBox.Caption = "Autre ON"     Else     Call LayerToggle(1, 0)     Non_de_la_checkbox_CheckBox.Caption = "Autre OFF"     End If  | 
					

Le premier chiffre dans les lignes Call LayerToggle(1, 1) et Call LayerToggle(1, 0) correspond au numéro du calque
Modifier le chiffe par le numéro de votre calque.
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  | 
						Private Sub BleuCheckBox_Click() If BleuCheckBox Then     Call LayerToggle(<em><strong>3</strong></em>, 1)     BleuCheckBox.Caption = "Autre ON"     Else     Call LayerToggle(<em><strong>3</strong></em>, 0)     BleuCheckBox.Caption = "Autre OFF"     End If End Sub Private Sub VertCheckBox_Click() If VertCheckBox Then     Call LayerToggle(<em><strong>4</strong></em>, 1)     VertCheckBox.Caption = "Autre ON"     Else     Call LayerToggle(<em><strong>4</strong></em>, 0)     VertCheckBox.Caption = "Autre OFF"     End If End Sub  | 
					
Pour enregistrer, fermer les fenêtres de Visual Basic.