Layer visibility vs. grouping


    Sponsored Links


  • 1. Creating new drawings from floor plans.
    I use visio to draw pre-fire plans. Often, I have a floor plan available. Is it possible to scan this floor plan into visio, assign layers and then manipulate the drawing as necessary to complete a pre-fire plan. So far, I have been pasting the floor plans into visio as a picture file. However, I am not able to manipulate the floor plan at all. Any advise is appreciated. Eric
  • 2. hyperlink to pop up-window
    How to make hyperlinks open in a popup-window instead of opening it on a new window? I have this large diagram and it would be great to get information about certain object to a small popup-window by clicking the object.. =/
  • 3. Dynamic org chart generation against Exchange in Visio?
    I can create an org chart dynamically against my company's Exchange server with Office 2003. I would like to share this with others in my company, but I want to make sure this works with previous versions of Office. Anyone know?
  • 4. Calculation of time elapsed
    I would like to know if the Visio calculate the times in each phase of a workflow diagram. I am providing in study in how long does it take to import/export a product in Brazil. If possible, can someone indicate me how to obtain this information in the Visio. Thanks. Hamilton Lira

Layer visibility vs. grouping

Postby TWFj » Tue, 02 Oct 2007 16:22:09 GMT

A group of objects, each one resides in a separate layer but some of the 
layers are shared (several objects reside in more than one layer). Now I want 
to switch one layer invisible (but the objects on it are also on the other 
layer which must remain visible) get the picture. Is it possible to 
infroce some rules regarding grouped objects and layer visibility (in cases 
like this)?

RE: Layer visibility vs. grouping

Postby QWwgRWRsdW5k » Wed, 03 Oct 2007 04:01:00 GMT

it's not a normal function so custom code/shape sheet modifications would 
probably be requried

Similar Threads:

1.Layer Visibility Problem 2002

This code will let you toggle the visibility layer called "Details" on
every page of a Visio document.  I found no functional code online to
do this in Visio 2002, so I figured I'd post it up.

It gets around a 2002 bug where pages that are not active are not
refreshed properly by setting each page to the active page and then
selecting all.

Sub DetailsToggle()
 Dim toggleValue As Integer
 Dim layerName As String
 Dim vsoLayer1 As Visio.Layer
 Dim vsoPage As Visio.Page
 Dim UndoScopeID1 As Long
 Dim originalActivePage As String

 layerName = "Details"

    UndoScopeID1 = Application.BeginUndoScope("Layer Properties")

    originalActivePage = ActiveWindow.Page
    For Each vsoPage In Application.ActiveDocument.Pages
        ActiveWindow.Page = vsoPage.Name
        For Each vsoLayer1 In vsoPage.Layers

            toggleValue = vsoLayer1.CellsC(visLayerVisible)

            If toggleValue = 1 Then
            toggleValue = 0
                toggleValue = 1
            End If

            If vsoLayer1.Name = layerName Then
                vsoLayer1.CellsC(visLayerVisible) = toggleValue
                vsoLayer1.CellsC(visLayerPrint) = toggleValue
            End If
        Next vsoLayer1
        Set vsoLayer1 = Nothing

    Next vsoPage
    Set vsoPage = Nothing

    ActiveWindow.Page = originalActivePage
    Application.EndUndoScope UndoScopeID1, True
End Sub

2.Set layer visibility on all pages in a Visio 2000 SR1 document

Hi all,

I want to be able to control layer visibility on all pages in a Visio
On the first page, I want to have checkboxes (MS Forms 2.0) to select
which layers should be visible and not. However, this only works for
the page on which the checkbox resides. On the other pages, the
shapesheet cells are updated but the page is not updated. I have to
select the visibility cell on each page and press "enter" to have the
page updated.

I have done some Google research and found out that this could be
caused by the
"display bug in Visio 2000 SR1". A workaround that only works once is
to activate each page in the VBA script before updating the
properties. But this is not a desired situation. Since I have only
found posts from 2002 regarding this issue, I am curious if other
workarounds are available for this issue.

I have the following VBA code to perform the visibility settings:

Private Sub SetLayerVisibility(pgobj As Visio.Page, layername As
String, visibility As Boolean)
Dim ilay As Integer
Dim layerobj As Visio.Layer

    ' Is the argument passed a Page?
    If (Not (pgobj.ObjectType = visObjTypePage)) Then
        ' Passed obj is not a Page!
        Debug.Print "  SetLayerVisibility(): Passed argument is not
page object!"
        Exit Sub
    End If
    If (pgobj.Layers.Count > 0) Then
        'Iterate trough all layers to find the referenced layer
        For ilay = 1 To pgobj.Layers.Count
            Set layerobj = pgobj.Layers(ilay)
            If (StrComp(layerobj.Name, layername) = 0) Then
                Debug.Print "  FOUND matching layer on page ";
pgobj.Name; " layer: "; layerobj.Name
                Visio.ActiveWindow.Page = pgobj.Name  'Activate the
page; workaround for the display update bug in V2K SR1
                layerobj.CellsC(visLayerVisible) = visibility
                layerobj.CellsC(visLayerPrint) = visibility

            End If
        Next ilay
        Debug.Print "  SetLayerVisibility(): No layers on page";
    End If
End Sub

Private Sub FirewallCheckbox_Click()
Dim ipag As Integer
Dim pagobj As Visio.Page
Dim curpg As Visio.Page

    'save the current activepage
    Set curpg = ActiveWindow.Page
    For ipag = 1 To ThisDocument.Pages.Count
        Set pagobj = ThisDocument.Pages(ipag)
        If (FirewallCheckbox.Value) Then
            ' Make Firewall layer visible
            Call SetLayerVisibility(pagobj, "Firewall", True)
            ' Make Firewall layer invisible
            Call SetLayerVisibility(pagobj, "Firewall", False)
        End If
    Next ipag
    'Restore the current active page
    ActiveWindow.Page = curpg.Name
End Sub

I hope anyone can help me with this issue!



3.Visio 2000 vs 2003 AND Global Layers

Sorry for the newbie mistake, I was trying to reply to another thread about a 
request to have a Global Layer feature.  I just went back and found the post, 
 it was on 7/18/2005.

My co-worker was previously able to turn off the printing or visibility of a 
layer across pages within the same document in Visio 2000.  The only way I 
can see to turn off a layer in Visio 2003 is on a page by page basis.

Do people use code/macros to get around this?  

I use Visio to sketch out User Interfaces.  These documents are often 30-50 
pages.  I want to move things like "developer notes" and "estimates" for each 
screen to a seperate layer,  so I can have all this information available, 
but then I want to turn off the Print or Visible property so my clients do 
not have to look at all of that detail, which can be overwhelming.


4.How to group layers

I have often drawings with 30-40 layers.
I would like to switch off more than one layer with just one pick, perhaps 5 
-10 layers at a time.
Therefore I would like to know how to make groups of layers to switch on/off.
I don't wan't the layers to be "grouped" as done by >rightclick >shape > 
group/ungroup, but some kind of macro or something else.

5.get shapes inside a group by layer


i have to shapes A and B.

A accepts shapes that are dropped on it
and B is added to group when dropped.
So now if i drop B on A, B is in the group.

A is member of layer 'LA'
and B is member of 'LB'

is it possible to select all members of LB?

The thing i am doing at the moment, is diging through
the A.shapes, to get all the B shapes inside A.

6. Manage Shapes by Groups or Layers?

7. Does Visio 2007 support group layer management?

8. How do I put layers in groups?

Return to VISIO


Who is online

Users browsing this forum: No registered users and 43 guest