Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Kent1Cooper
en respuesta a: Kent1Cooper


@Kent1Cooper wrote:

.... It doesn't verify that you're in paper space when you start, but could be made to, and to verify that you actually selected a Viewport ....


Like this:

(defun C:ZVAM (/ vp vpdata); = Zoom to Viewport Area in Model Space
  (if
    (and 
      (= (getvar 'tilemode) 0); in Paper Space
      (setq vp (car (entsel "\nSelect Viewport to Zoom to its area in Model Space: ")))
      (setq vpdata (entget vp))
      (member '(0 . "VIEWPORT") vpdata)
    ); and
    (progn ; then
      (setvar 'tilemode 1); into Model Space tab
      (command "_.zoom" "_c" "_none" (cdr (assoc 12 vpdata)) (cdr (assoc 45 vpdata)))
    ); progn
    (prompt "\nYou are not in Paper Space, or did not select a Viewport."); else
  ); if
  (princ)
); defun
Kent Cooper, AIA