Jump to content

Recommended Posts

Posted

Zoom extends

;zOOM EXTENDS ALL LAYOUTS
(defun c:LZE (/ Ctab Layout)
 (princ "\nLayouts Zoom Extents")
 (setq Ctab (getvar "CTAB"))
 (foreach Layout (layoutlist)
   (command "LAYOUT" "S" Layout)
   (command "PSPACE")
   (command "ZOOM" "E")
 )
 (setvar "CTAB" Ctab)
 (princ)
)

 

 

Zoom window

(defun c:LZW (/ Ctab Layout P1 P2)
 (princ "\nLayouts Zoom Window")
 (if (/= (setq Ctab (getvar "CTAB")) "Model")
   (progn
     (command "PSPACE")

     (if (and
    (setq P1 (getpoint "\nSpecify first corner: "))
    (setq P2 (getcorner P1 "Specify opposite corner: "))
    )
       (foreach Layout (layoutlist)
         (command "LAYOUT" "S" Layout)
         (command "PSPACE")
         (command "ZOOM" "W" P1 P2)
       )
     )
   )
   (command "ZOOM" "W")
 )
 (setvar "CTAB" Ctab)
 (princ)
)

 

Both lisps NOT mine

Posted

 

Both lisps NOT mine

 

Great routines sir.

 

But since they don't belong to you. Why did you remove the name of the Author ?

 

A very big question .

Posted

Thanks a lot asos. This works perfectly as required & helps aout a lot to me.

 

Cheers,

Ashish

Posted

(defun c:lze (/ This_Drawing lyouts)
(setq This_Drawing (vla-get-activedocument (vlax-get-acad-object))
    lyouts (vla-get-layouts  This_Drawing))
      (vlax-for ly lyouts
  (if (eq (vla-get-modeltype ly) :vlax-false)
     (progn
    (vl-cmdf "_.layout" "S" (vla-get-name ly))
    (vl-cmdf "_.Zoom" "E")
   )
 )
)
 )

 

 

oops :ouch: too late :)

Posted
(defun c:lze (/ This_Drawing lyouts)
(setq This_Drawing (vla-get-activedocument (vlax-get-acad-object))
    lyouts (vla-get-layouts  This_Drawing))
      (vlax-for ly lyouts
  (if (eq (vla-get-modeltype ly) :vlax-false)
     (progn
    (vl-cmdf "_.layout" "S" (vla-get-name ly))
    (vl-cmdf "_.Zoom" "E")
   )
 )
)
 )

 

oops :ouch: too late :)

 

Nice one buddy, but it does not go back to the Model Space as it was before.

 

Thank you

Posted

I guess the following would solve the issue at the end of your routine.

 

(setvar 'tilemode 1)

 

Thanks

Posted

Hi,

 

Can we stop the screen fluctuations & scrooling of text over command line during execution of this LZE command??

This irritates eyes, specially when you have several layouts.

 

- Ashish

Posted

(defun c:lze ( / ot ac )
 (vl-load-com)
 (setq ot (getvar 'CTAB) ac (vlax-get-acad-object))

 (foreach l (layoutlist) (setvar 'CTAB l) (vla-ZoomExtents ac))
 (setvar 'CTAB ot)
 (princ)
)

Or to avoid Zooming in Viewports:

 

(defun c:lze ( / ot ac doc )
 (vl-load-com)
 (setq ot (getvar 'CTAB) ac (vlax-get-acad-object) doc (vla-get-ActiveDocument ac))

 (foreach l (layoutlist)
   (setvar 'CTAB l) (vla-put-MSpace doc :vlax-false) (vla-ZoomExtents ac)
 )
 (setvar 'CTAB ot)
 (princ)
)

  • Thanks 1
Posted (edited)

(vla-ZoomExtents ac)) !!!!

 

 

thats what i'm lookig for (slap forehead) ... cool Lee MAc you never cease to amazed us :)

 

(defun c:PE:LZE ()
  (vl-load-com)(setq prv (getvar 'CTAB) dwg (vlax-get-acad-object))
(mapcar '(lambda (x)
    (setvar 'CTAB x)
    (vla-ZoomExtents dwg))
    (layoutlist))
(setvar 'CTAB prv)
 )

 

To be honest, i never knew about (layoutlist) until today... learning new stuff everyday

:)

Edited by pBe
add code
Posted

Zoom window one I sometimes use...

 

(defun c:LZW (/ ctab pt cor)
 ;; Layout Zoom Window (zoom to same window in all layouts)
 ;; Alan J. Thompson, 11.10.09
 (if (zerop (getvar 'tilemode))
   (progn (setq ctab (getvar 'ctab))
          (vla-put-MSpace
            (cond (*AcadDoc*)
                  ((setq *AcadDoc* (vla-get-activedocument
                                     (cond (*Acad*)
                                           ((setq *Acad* (vlax-get-acad-object)))
                                     )
                                   )
                   )
                  )
            )
            :vlax-false
          )
          (if (and (setq pt (getpoint "\nSpecify first corner:  "))
                   (setq cor (getcorner pt "\nSpecify opposite corner: "))
              )
            ((lambda (zoom)
               (foreach x (layoutlist)
                 (setvar 'ctab x)
                 (vla-put-MSpace *AcadDoc* :vlax-false)
                 (apply (function vla-ZoomWindow) zoom)
               )
               (setvar 'ctab ctab)
             )
              (cons *Acad* (mapcar (function vlax-3d-point) (list pt cor)))
            )
          )
   )
   (alert "Sorry, command not allowed in Model Tab.")
 )
 (princ)
)

Posted

Thanks Lee MAc. Can't we stop this irritating blinking screen during execution of this routine!!!

Posted
Thanks Lee MAc. Can't we stop this irritating blinking screen during execution of this routine!!!

 

Close your eyes?

Posted
Any excuse lol :P

If I close my eyes, I'll be too tempted for a nap.

Posted
:lol: :twisted:

One could just stand up and wave glow sticks around.

 

STROBE_LIGHT.gif

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...