Accessing objects on multiple layers

Started by CAT5Mangler, June 08, 2012, 06:56:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I have a building diagram for a dorm with three floors. The purpose of the diagrams are to identify data ports both physically and logically (Patch panel, network equipment connections).
I placed three drawings, one for each floor, into the VISIO workspace. Each floor is on it's own layer, and each layer can be shown by double-clicking one of three rectangles whose dbl-click event runs a macro changing the Visible properties to "1" or "0", depending on which floor is selected.
The problem occurs when shapes belong to one or more layers. All other shapes on the layer are set to not visible, but any shapes belonging to more than one layer remain visible while the selected floor is also visible.
Here's the code for the first floor. Second and third -- are the same code in different macros -- Just change the values for the visible property to make the selected floor visible and hide the other two. FirstFloor is 8, Second is 9, Third is 10

Public Sub FloorsVisibleFirst()

Set APage = ActivePage
Set ACell = APage.PageSheet.Cells("Layers.Visible[8]")
Set BCell = APage.PageSheet.Cells("Layers.Visible[9]")
Set CCell = APage.PageSheet.Cells("Layers.Visible[10]")
If ACell.Formula <> "1" Then
    ACell.Formula = "1"
    BCell.Formula = "0"
    CCell.Formula = "0"
    End If
    End Sub

How can I change the "Visible"  property to "1"  for shapes belonging to the "FirstFloor" layer, and also belong to the "PORT" layer or "Window" layer, as well as shapes that only are members of the "FirstFloor" layer?