我觉得那看起来很熟悉。
... 那么为什么不先检查未保存的更改呢?
- (vl-load-com)
- (defun c:ZoomAll (/ *error* oldCtab acApp mspace)
- (defun *error* (msg)
- (and oldCtab (setvar 'ctab oldCtab))
- (cond ((not msg)) ; Normal exit
- ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
- ((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
- )
- (princ)
- )
- (if (= 0 (getvar 'dbmod))
- (if (and (setq oldCtab (getvar 'ctab))
- (setq acApp (vlax-get-acad-object))
- )
- (foreach tab (layoutlist)
- (setvar 'ctab tab)
- (if (setq mspace (< 1 (getvar 'cvport)))
- (vla-put-mspace acDoc :vlax-false)
- )
- (vla-zoomall acApp)
- (if mspace
- (vla-put-mspace acDoc :vlax-true)
- )
- )
- )
- (prompt "\n** Unsaved changes, save and try again ** ")
- )
- (*error* nil)
- )
|