PDA

View Full Version : restore zoom level



bbapties
2004-08-02, 08:59 PM
I have a button on my custom toolbar that I use to rotate my drawing and my ucs to a object.
This is what I have in the button....

^C^Cucs;e;\plan;;_UCSICON;N;
I want to add to this and make it be able to remember the scale and location of zoom level that I am at so that it zooms back to the area I was in before, right now it zooms extents upon the plan command....Can anyone give me a hand on how to accomplish this???
Thanks in advance.

sinc
2004-08-03, 06:24 AM
Possibly you have ucsfollow set to 1? If so, set it to 0. Note that this setting is viewport-dependent, so you'll have to do it in model space as well as in each of your paperspace viewports.

bbapties
2004-08-03, 01:11 PM
no, it is set to 0.. I'm working in model when I use this, I geuss I should have cleared that up as well. I use this button for when I'm in model. When I'm working on a very large site and want to change my ucs and monitor to be perpindicular to an object, I use my button. It does what I want, but then I have to find what I was looking at previously, because the plan command automatically zooms extents....So is there a way to get remember the center point of my screen (example= 54568.26,65482.26,0) and the zoom level of my screen. and restore it after the plan command.

matt.worland
2004-08-03, 01:47 PM
I believe this is the command line version of what you are looking for.

Command: -view
Enter an option [?/Categorize/lAyer state/Orthographic/Delete/Restore/Save/Ucs/Window]: s
Enter view name to save: current

UCSVIEW = 1 UCS will be saved with view
Command: ze zoom
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: extents

Command: -view
Enter an option [?/Categorize/lAyer
state/Orthographic/Delete/Restore/Save/Ucs/Window]: r
Enter view name to restore: current

Hope this helps.
Matt

bbapties
2004-08-03, 02:06 PM
thanks, thats getting close to what I'm looking for.

but when I save the view then rotate my ucs and then rotate my view. I try to restore the view, but it restores back to the same exact view as before... I would like it to look at the same point but with the new rotation that I have set.

Sorry it's kind of hard to explain with out my showing an example on my screen.

matt.worland
2004-08-03, 02:29 PM
Gotcha, makes sense now, tho I am unsure of an easy way to do that. I'll look around.

bbapties
2004-08-03, 02:36 PM
I appreciatte it :D

It doesnt have to be in command line.. That's just how I started this button cause it was so easy...Now that I want to add to it. It could be in a lisp or others... I just want to have the final result.

thanks again for looking...

matt.worland
2004-08-03, 02:38 PM
Before you change your UCS get your viewsize variable.

(setq ViewSize (getvar "viewsize"))

Then set your new UCS and run Plan.

Finally run the zoom command and choose center.
enter 0,0 and !ViewSize for the scale.

Hope this helps.

bbapties
2004-08-03, 02:50 PM
PERFECT!

:Puffy:

Everyone is going to be so jealous here at work! :lol:

Thanks again for the help!

matt.worland
2004-08-03, 02:54 PM
Glad that I could help.

aicm.44794
2004-08-03, 06:43 PM
PERFECT!

:Puffy:

Everyone is going to be so jealous here at work! :lol:

Thanks again for the help!
bbapties,
Could you post your completed routine.
Thanks
Larry

bbapties
2004-08-03, 06:50 PM
**UCS_SNAP
**TB_UCS_SNAP
ID_ucs_snap_0 [_Toolbar("ucs snap", _Floating, _Show, 3, 1, 1)]
ID_UserButton_8 [_Button("rotate ucs", "ICON0045.bmp", "ICON_16_BLANK")]^C^C(setq ViewSize (getvar "viewsize"));ucs;e;\plan;;_UCSICON;N;zoom;c;0,0;!viewsize
[--]
ID_UserButton_9 [_Button("UCS (world)", "ICON0529.bmp", "ICON_16_BLANK")]^C^Cucs;W;PLAN;;

Here is the complete toolbar from my mns file.

I even grabbed my icons for you :)