Center zoom on selection

Started by Yacine, May 23, 2010, 03:57:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

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
Yacine

JuneTheSecond

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

That is also what I do (with a rectangle), but I don't like it.
Yacine

JuneTheSecond

Best Regards,

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

vojo

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

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

#6
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.
Best Regards,

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

Yacine

#7
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
Yacine

JuneTheSecond

#8
Exactly, Yacine.

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

Thank you Yacine.  :) :) :) :) :) :) :)
Best Regards,

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

Yacine

#9
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?
Yacine

JuneTheSecond

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.

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

It's perfect now. Thank you.
Yacine