谢谢版主我的问题已解决,第二点没有想到.现在的程序如下: (defun c:jc(/ a a1 a2 ang b b1 b2 obm r w oom) (setq obm (getvar "blipmode")) (setq oom (getvar "osmode")) (initget 7) (setq w (getreal "\nwidth of jc:")) (setq r (/ w 2)) (setvar "blipmode" 1) (initget 1) (setq a (getpoint "\nlocate first center:")) (initget 1) (setq b (getpoint a "\nlocate second center:")) (setvar "blipmode" 0) (setq ang (angle a b)) (setq a1 (polar a (- ang (/ pi 2)) r)) (setq a2 (polar a (+ ang (/ pi 2)) r)) (setq b1 (polar b (- ang (/ pi 2)) r)) (setq b2 (polar b (+ ang (/ pi 2)) r)) (setvar "cmdecho" 0) (setvar "osmode" 0) (command "pline" a1 b1 "a" b2 "l" a2 "a" "cl") (setvar "cmdecho" 1) (setvar "blipmode" obm) (setvar "osmode" oom) (princ) ) |