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

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 87
  • ...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: 246
  • ByLayer=>Not0
Re: Grip and Snapless Zoom
« Reply #1 on: July 23, 2021, 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

ScottMC

  • Newt
  • Posts: 87
  • ...if we don't ask, we won't receive..
Re: Grip and Snapless Zoom
« Reply #2 on: July 23, 2021, 08:36:54 PM »
Another, which won't work is, assigning [ z = 'zoom ] in AliasEditor. I put as a mouse-click in my 'wheel-flyout' ID_TZoom       [Zoom(T)]'zoom
Thanks

Now my default zoom deactivates the grips.. hmm, a new mystery. Do like default better the way it works.
« Last Edit: August 03, 2021, 09:59:42 PM by ScottMC »