Author Topic: Center zoom on selection  (Read 10687 times)

0 Members and 1 Guest are viewing this topic.

Yacine

  • Hero Member
  • *****
  • Posts: 2574
Center zoom on selection
« on: May 22, 2010, 10:57:30 PM »
I appreciate very much the possibility to zoom in and center the view on the selected shape by using the scroll wheel. (Centering on the current position of the mouse pointer, as CAD tools do, would be better, but the prior selection of a shape is not a big hurdle).

If you happen to have groups with sub-shapes much bigger than the container itself, Visio will center the zoom on the center of the sub-shapes extents.

Is there a way to get the center on the dimensions of the group?
----
added a vsd to illustrate, in case my explanation is not clear enough
« Last Edit: May 22, 2010, 11:58:36 PM by Yacine »
Yacine

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Center zoom on selection
« Reply #1 on: May 23, 2010, 05:22:50 AM »
When my drawing is complicated, and when I wish to center zoom at the point,
I used to place a small circle near the point, select the circle and turn the mouse wheel.
Center zoom at the mouse cursol is expected for all users.  :) :) :) :) :)
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

  • Hero Member
  • *****
  • Posts: 2574
Re: Center zoom on selection
« Reply #2 on: May 23, 2010, 05:46:31 AM »
That is also what I do (with a rectangle), but I don't like it.
Yacine

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Center zoom on selection
« Reply #3 on: May 23, 2010, 07:06:56 AM »
I don't like, either.  ;) ;) ;) ;)
Best Regards,

Junichi Yoda
http://june.minibird.jp/

vojo

  • Hero Member
  • *****
  • Posts: 1227
Re: Center zoom on selection
« Reply #4 on: May 23, 2010, 08:49:00 AM »
could also do this

- set your shapes so that double click does the docmd to open a new window
- select the shape of interest
- double click

Yacine

  • Hero Member
  • *****
  • Posts: 2574
Re: Center zoom on selection
« Reply #5 on: May 23, 2010, 10:37:19 AM »
Thank you Vojo,
but it's about (fast) navigating in the drawing, not so much about selecting. The alternative would rather be to utilize the navigation window. I've seen some colleagues who prefer this tool.
Yacine

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Center zoom on selection
« Reply #6 on: May 24, 2010, 12:00:21 AM »
My another attempt is using mouse event and ScrolViewTo method in VBA.

0. Download and open attached drawing, and enable VBA macro.
1. Right click on the page and select menu Start Center Zoom
2. Press mouse wheel till wheel mark appears.
3. Wait for view scrolling to the center.
4. Turn mouse wheel to zoom.
 .
 .
 .
X. Right click on the page and select End Center Zoom.
« Last Edit: May 24, 2010, 12:10:29 AM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

  • Hero Member
  • *****
  • Posts: 2574
Re: Center zoom on selection
« Reply #7 on: May 24, 2010, 02:09:38 AM »
Very nice idea Junichi, it worked fine.
However, playing with your solution I made a discovery that seems to be an ever easier workaround. When the center on zoom and the zoom on scroll are set off (that's what your macro did), you can zoom on the position of your mouse if you press the ctrl-key at the same time.
cheers
« Last Edit: May 24, 2010, 03:55:44 AM by Yacine »
Yacine

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Center zoom on selection
« Reply #8 on: May 24, 2010, 02:30:02 AM »
Exactly, Yacine.

I've revised and attached it.
Now you can center on mouse cursol position without pressing mouse wheel.

Thank you Yacine.  :) :) :) :) :) :) :)
« Last Edit: May 24, 2010, 02:34:40 AM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

  • Hero Member
  • *****
  • Posts: 2574
Re: Center zoom on selection
« Reply #9 on: May 24, 2010, 02:40:23 AM »
This last one however does not work: "System Error &H80004005 (-2147467259) unknown error " (Vista32 + Visio 2007).

... and a question: when your macro is running can I still start other macros?
« Last Edit: May 24, 2010, 02:43:28 AM by Yacine »
Yacine

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Center zoom on selection
« Reply #10 on: May 24, 2010, 02:53:42 AM »
I am sorry. Here is Rev2.
This drawing includes only next code, and not includes mouse events.
And then, I think, you can run other macro.
Code: [Select]
Sub startCenterZoom()
    Application.Settings.ZoomOnRoll = True
    Application.Settings.CenterSelectionOnZoom = False
End Sub

Sub endCenterZoom()
    Application.Settings.ZoomOnRoll = False
    Application.Settings.CenterSelectionOnZoom = False
End Sub

Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

  • Hero Member
  • *****
  • Posts: 2574
Re: Center zoom on selection
« Reply #11 on: May 24, 2010, 02:58:24 AM »
It's perfect now. Thank you.
Yacine