Author Topic: Grip and Snapless Zoom  (Read 73 times)

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 79
  • ...if we don't ask, we won't receive..
Grip and Snapless Zoom
« on: July 21, 2021, 05:03:34 PM »
Just wonder if someone knows of a variable associated with zoom. I'd given up long ago and wrote a shorty to ease the trouble. Enjoy..
 
Code: [Select]
(defun c:z (/ osp ssp) ;; ->> Remove "Z Zoom" from Alias Editor
    (setvar 'cmdecho 0)
        (princ "\n Grip/Snap-Free Zoom..")
        (setq osp (getvar 'osmode))
        (setq ssp (getvar 'snapmode))
        (setvar 'snapmode 0)
            (vl-cmdf "osmode" 16384 "zoom" pause pause) ;; needed pauses to get the grips to remain off
        (setvar 'snapmode ssp)
        (setvar 'osmode osp)
    (setvar 'cmdecho 1)
 (princ)
)
« Last Edit: July 21, 2021, 05:21:47 PM by ScottMC »

tombu

  • Bull Frog
  • Posts: 240
  • ByLayer=>Not0
Re: Grip and Snapless Zoom
« Reply #1 on: Today at 08:25:04 AM »
Here's one for when you do want to use default osnaps:
Code: [Select]
(defun c:ZSnap ( / *error* osmode pt1 pt2)
 (defun *Error* (msg) ; embedded defun
   (setvar 'osmode osmode)
   (if (/= s "Function cancelled")
     (princ (strcat "\nError: " msg))
   )
   (princ)
 )

 (setq osmode (getvar 'osmode))
 (if (> (getvar 'osmode) 16384)
  (setvar 'osmode (- osmode 16384))
 )
 (setq pt1 (getpoint "\nSelect First Window Point: "))
 (setq pt2 (getcorner pt1 "\nSelect Second Window Point: "))
 (command "._zoom" "_w" pt1 pt2) ; end zoom
 (setvar 'osmode osmode)
)
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D