考虑这种适应性:
- (vl-load-com)
- (defun c:ZoomAll (/ *error* oldCtab acApp)
- (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 (and (setq oldCtab (getvar 'ctab))
- (setq acApp (vlax-get-acad-object))
- )
- (foreach tab (layoutlist)
- (setvar 'ctab tab)
- (vla-zoomall acApp)
- )
- )
- (*error* nil)
- )
|