;; | ---------------------------------------------------------------------------- ;; | MI_End ;; | ---------------------------------------------------------------------------- ;; | Function : Completion code after any command. ;; | Argument : (none) ;; | Action : Ends the UNDO group, restores $orig$ view and OSNAP setting ;; | Updated : August 24, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun MI_End( / tmp ViewRestore ) (MI_SetRegistryValues) (if #CL (progn (if (tblsearch "LAYER" #CL) (LA_mk_c_lyr #CL "") ) )) (setq tmp (ssget "_X" (list (cons 8 "$temp$,$temp1$")))) (if tmp (command "._Erase" tmp"") ) (if (member (strcase #CL) (list "$TEMP$" "$TEMP1$")) (progn (LA_mk_c_lyr "0" "") (setq #CL "0") )) (foreach tmp (list "$temp$" "$temp1$") (if (tblsearch "LAYER" tmp) (command "._Purge" "_Layer" tmp "_No") ) ) (if #APE (setvar "APERTURE" #APE)) (if #ANGD (setvar "ANGDIR" #ANGD)) (if #AB (setvar "ANGBASE" #AB)) (if #PBX (setvar "PICKBOX" #PBX)) (if #DZ (setvar "DIMZIN" #DZ)) (if #OS (setvar "OSMODE" #OS)) (if #RGM (setvar "REGENMODE" #RGM)) (if (not (zerop #TXH)) (setvar "TEXTSIZE" #TXH) ) (if (= (getvar "TILEMODE") 1) ; Model Space (setq ViewRestore T) (progn ; Paper Space (if (<= (getvar "CVPORT") 1) (setq ViewRestore T) (setq ViewRestore nil) ) )) (if ViewRestore (progn (if (/= #CurCmd "AUTOPAN") (progn (command "._View" "_Restore" "$ORIG$" "._View" "_Delete" "$ORIG$" ) (if (= #OperatingEnv "BricsCAD") (command "._Zoom" "_Previous") ) )) )) (if #LastSS (command "._Select" #LastSS "") ) (command "._Undo" "_End") (if #CME (setvar "CMDECHO" #CME)) (if #UV (setvar "UCSVIEW" #UV)) (setq #EndDate (MI_SumDay (MI_Today)) #EndTime (MI_Now) ) ;; Perform garbage collection to handle ActiveX memory leaks (gc) (gc) )