TheSwamp

CAD Forums => CAD General => Topic started by: Andrea on March 16, 2006, 02:16:13 PM

Title: zoom extend when changing layout..
Post by: Andrea on March 16, 2006, 02:16:13 PM
Hi all...

in a drawing...
it alway zoom extend when changing layout...
is there any variable to set for this ?

also, it regen the drawing each time....even the variable regenauto set to off.

 :|
Title: Re: zoom extend when changing layout..
Post by: T.Willey on March 16, 2006, 02:24:57 PM
Try setting "ucsfollow" to 0 in all layouts.
Title: Re: zoom extend when changing layout..
Post by: Andrea on March 16, 2006, 03:02:27 PM
Try setting "ucsfollow" to 0 in all layouts.

wow...

thanks T.Willy..
did the job.

 :roll:
Title: Re: zoom extend when changing layout..
Post by: T.Willey on March 16, 2006, 03:14:58 PM
You're welcome.  That happened to me once in like three or four viewports.  That was the worst.  Filed that one away.
Title: Re: zoom extend when changing layout..
Post by: Andrea on March 16, 2006, 03:47:13 PM
Just a little more thing...

this is happen also if we are in TILEMODE 0
when trying to enter in a no-locked Mview...

it zoom extent the Vport each time..
is there another variable for this ?

 :?
Title: Re: zoom extend when changing layout..
Post by: MP on March 16, 2006, 03:54:01 PM
I don't have time to explain the following, and I apologize for that, but I wrote this quick and dirty several years ago at the request of my users, and they expressed much gratitude.

Code: [Select]
(defun c:UCSClassic ( / _ForEachVP _DoIt _Main )

    (defun _ForEachVP (quoted_task / vps)
   
        (setq vps
            (apply 'append
                (mapcar
                   '(lambda (x / v) (if (/= 1 (setq v (car x))) (list v)))
                    (reverse (vports))
                )
            )
        )

        (if (eq 0 (getvar "tilemode"))
            (cond
                (   (eq 1 (getvar "cvport"))
                    (cond
                        (   vps
                            (command ".mspace")
                            (_ForEachVp quoted_task)
                            (command ".pspace")
                        )
                    )
                )
                (
                    (foreach x vps
                        (setvar "cvport" x)
                        (eval quoted_task)
                    )
                )
            )
            (foreach x vps
                (setvar "cvport" x)
                (eval quoted_task)
            )
        )
    )

    (defun _DoIt ( / tilemode )
   
        (foreach x
           '("ucsortho" "ucsview" "ucsfollow" "ucsvp")
            (setvar x 0)
        )
       
        (_ForEachVP '(setvar "ucsvp" 0))
       
        (princ "\nUCSORTHO has been set to 0.")
        (princ "\nUCSVIEW has been set to 0.")
        (princ "\nUCSFOLLOW has been set to 0.")
       
        (princ
            (strcat
                "\nFor TILEMODE = "
                (itoa (setq tilemode (getvar "tilemode")))
                " UCSVP set to 0 (off) for each active viewport."
            )
        )
       
        (princ
            (strcat
                "\nFor TILEMODE = "
                (itoa (abs (1- tilemode)))
                " UCSVP remains unaltered for each viewport."
            )
        )
   )
   
   (defun _Main ( / cmdecho )
   
       (setq cmdecho (getvar "cmdecho"))

       (setvar "cmdecho" 0)

       (if (zerop (getvar "tilemode"))
          (cond
             (  (eq 1 (getvar "cvport"))
                (command ".zoom" "_extents")
                (command ".mspace")
                (_DoIt)
                (command ".pspace")
                (command ".zoom" "_previous")
             )
             (  t
                (command ".pspace")
                (command ".zoom" "_extents")
                (_DoIt)
                (command ".zoom" "_previous")
                (command ".mspace")
             )
          )
          (_DoIt)
       )

       (setvar "cmdecho" cmdecho)

       (princ)
       
    )
   
    (_Main)
   
)

Have fun.

:)
Title: Re: zoom extend when changing layout..
Post by: T.Willey on March 16, 2006, 03:57:08 PM
That is what was happening to me.  Best thing to do is either
Lock the viewport
Make the vp active
setq ucsfollow to 0
exit the vp
unlock the vp

Or like Michael's code

Make the vp active
set ucsfollow to 0
zoom previous
exit the vp