Background shape that does not show up in foreground page

Started by Jennifer, November 15, 2014, 05:11:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jennifer

Is there a way to have a shape on a background page (such as guides or comments) that is not visible on the foreground pages?
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

Are wanting these features to always be visible on the background page but become invisible when you switch to any drawing page?

Wapperdude
Visio 2019 Pro

Jennifer

Quote from: wapperdude on November 16, 2014, 12:20:01 AM
Are wanting these features to always be visible on the background page but become invisible when you switch to any drawing page?
Yes, exactly. I want to see them when I am working on the background page so I can leave the proper amount of room for objects that will be placed on the foreground page (or a higher level background page).

What would be really cool is if I could switch them on and off on the foreground page. Maybe I'll try fiddling around with layers.

J
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

I assigned all of the guide shapes to a Guides layer. Now I can turn them on and off as a group, but only from the background page. The layer is not transferred to the foreground page, so I can't turn it off from there. I don't see any other way to turn the guides on and off without going to the background layer. It's inconvenient, but workable.

Does anyone have any other suggestions?

Tx, J
Using Visio 2019, part of Office 365 on Windows 10

Croc

I can only suggest to add macro  :(
Dim WithEvents win As Visio.Window

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
    Set win = ActiveWindow
End Sub

Private Sub win_WindowTurnedToPage(ByVal Window As IVWindow)
    If ActivePage Is ActiveDocument.Pages("Background-1") Then
        ActiveDocument.Pages("Background-1").PageSheet.Cells("Layers.Visible") = True
    Else
        ActiveDocument.Pages("Background-1").PageSheet.Cells("Layers.Visible") = False
    End If
End Sub

Yacine

@Croc,
I don't think a macro is necessary.
Just copy a shape assigned to the specific layer to the desired page and the layer is available there.
Opening the layer dialog is as fast as running a macro.
Yacine

Croc

QuoteOpening the layer dialog is as fast as running a macro.
No. The macro runs automatically. See the attached file.
QuoteI don't think a macro is necessary.
I agree. If the document contains no other macros, better without them.

wapperdude

@Yacine: 
QuoteJust copy a shape assigned to the specific layer to the desired page and the layer is available there.
.  This misses the point of shapes being on background page.  The goal I think is to have some guide shapes, notes, etc on the background, but not show up on the drawing pages.

Since Visio has no change active page event available, then macro is the only way to capture such an event and automatically hide / show the shapes in question.  It's easy enough to write shapesheet formulas that control layers on non-active pages, which could be toggled using action menu on each page.  But, it's not automatic, and does require modifying every page to have said implementation, as there is no way to sense when a page change occurs.

Croc's macro looks like the required approach to make this automatic.

Wapperdude
Visio 2019 Pro

Yacine

@Wapperdude,
the point I missed, is that even if the layers have the same name on different pages, they are not the same. So basically you can have a "back" layer visible on the background page, but not on the front page.


So that croc's macro makes more sense.


For people preferring shapesheet there is however a workaround.
A simple SETF/GETREF on the foreground page can switch the layer's visibility.
SETF(GetRef(Pages[Background-1]!ThePage!Layers.Visible),NOT(Pages[Background-1]!ThePage!Layers.Visible))


There are two different places where this formula can be implemented: the page itself or a shape placed on this page.
Having it available on the right-click of the mouse is elegant, but it doesn't propagate to duplicated pages. A macro could help writing this formula in the new page.
Having it in a shape is not so elegant, but as easy as dropping a shape from a stencil.


Last but not least, a big disadvantage is the hard-coded name of the background page. Don't know if one could transform the string "Background-1" to the actual page object.

Yacine

wapperdude

@Yacine:  At least we're on the same page!   ::)  Pun intended.
Visio 2019 Pro