你的程序是无法正确退出的,这在我回答你的时候已经说过这个问题了。。。
你看看这个。。。右键退出。。。
- (defun Sel (_types msg / gr ent m ty)
- (defun com(ty tylst / i rVal)
- (setq i 0)
- (while (< i (length tylst))
- (if (= ty (nth i tylst))
- (progn (setq rVal t) (setq i (length tylst)))
- )
- (setq i (1+ i))
- )
- rVal
- )
- (prompt msg)
- (setq m nil)
- (while (not m)
- (setq gr (grread 2 4 2))
- (cond
- ((= (car gr) 3)
- (setq ent (ssget (cadr gr)))
- (if (not (and ent (com (cdr (assoc 0 (entget (setq ent (ssname ent 0))))) _types)))
-
- (setq ent nil)
- )
- (setq m t)
- )
- ((= (car gr) 25) (setq m t))
- )
- )
- (princ "\n")
- (if ent (list ent (cadr gr))
- (if (= 25 (car gr)) 0 1))
- )
- (defun o_set ()
- (setq enta (sel '("LINE" "LWPOLYLINE" "POLYLINE" "SPLINE") "\n选择偏移对象..."))
- (cond
- ((= (type enta) 'LIST)
- (setvar "cmdecho" 1)
- (command "offset" dist enta pause "")
- (setq e1 (entlast))
- (setvar "cmdecho" 0)
- (command "change" e1 "" "p" "la" ofe "")
- )
- ((= enta 0) (setq m nil))
- )
- )
- (defun c:op (/ oce ofe ode e1)
- (setq ode (getvar "osmode"))
- (setq oce (getvar "cmdecho"))
- (setq ofe (getvar "clayer"))
- (setvar "osmode" 0)
- (setq m t)
- (setq dist (getreal (strcat "输入偏移距离<"
- (rtos (getvar "offsetdist"))
- ">:"
- )
- )
- )
- (if (not dist)
- (setq dist (getvar "offsetdist"))
- )
- (while m
- (o_set)
- )
- (setvar "cmdecho" oce)
- (setvar "osmode" ode)
- (prin1)
- )
|