Author Topic: zoom extend when changing layout..  (Read 2147 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
zoom extend when changing layout..
« 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.

 :|
Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: zoom extend when changing layout..
« Reply #1 on: March 16, 2006, 02:24:57 PM »
Try setting "ucsfollow" to 0 in all layouts.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: zoom extend when changing layout..
« Reply #2 on: March 16, 2006, 03:02:27 PM »
Try setting "ucsfollow" to 0 in all layouts.

wow...

thanks T.Willy..
did the job.

 :roll:
Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: zoom extend when changing layout..
« Reply #3 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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: zoom extend when changing layout..
« Reply #4 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 ?

 :?
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: zoom extend when changing layout..
« Reply #5 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.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: zoom extend when changing layout..
« Reply #6 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
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.