1.WHEN (setq crd '(0 0)) ,RIGHT
2.WHEN (SETQ CRD (GETPOINT)) ,WRONG
(setq crd '(0 0))
;(SETQ CRD (GETPOINT))
(command "-layer" "make" "aicr317" "c" 1 "" "")
(setq x (nth 0 crd))
;;;;;(setq x 0) ;;;WHEN USE (GETPOINT) AND (SETQ X 0) ,IT IS ALSO RIGHT
(setq y (nth 1 crd))
(setq A0 (list (- x 37.5) (+ y 2)))
(setq A1 (list (- x 37.5) (+ y 12)))
(setq A2 (list (- x 25 5.5) (+ y 12)))
(setq A3 (list (- x 25) (+ y 12)))
(setq A4 (list (+ (- x 25) 5.5) (+ y 12)))
(setq A5 (list (- x 9) (+ y 12)))
(setq A6 (list (- x 0) (+ y 12)))
(setq A7 (list (+ x 9) (+ y 12)))
(setq A8 (list (- (+ x 25) 5.5) (+ y 12)))
(setq A9 (list (+ x 25) (+ y 12)))
(setq A10 (list (+ x 25 5.5) (+ y 12)))
(setq A11 (list (+ x 37.5) (+ y 12)))
(setq A12 (list (+ x 37.5) (+ y 2)))
(setq A13 (list (+ x 25 5.5) (+ y 2)))
(setq A14 (list (+ x 25) (+ y 2)))
(setq A15 (list (- (+ x 25) 5.5) (+ y 2)))
(setq AA (/ (- 25 9 5.5) 2)) ;;;;;;;A7和A8的中点
(setq A16 (list (+ 9 AA) (+ y 2)))
(setq A17 (list (+ 9 AA) (+ y 0)))
(setq A18 (list (+ x 9) (+ y 0)))
(setq A19 (list (- x 9) (+ y 0)))
(setq A20 (list (- (+ 9 AA)) (+ y 0)))
(setq A21 (list (- (+ 9 AA)) (+ y 2)))
(setq A22 (list (+ (- x 25) 5.5) (+ y 2)))
(setq A23 (list (- x 25) (+ y 2)))
(setq A24 (list (- x 25 5.5) (+ y 2)))
;;中心线
(setq A25 (list (- x 25) (+ y 17)))
(setq A26 (list (- x 25) (- y 5)))
(setq A27 (list (- x 0) (+ y 22)))
(setq A28 (list (- x 0) (- y 10)))
(setq A29 (list (+ x 25) (+ y 17)))
(setq A30 (list (+ x 25) (- y 5)))
;;填充部分
(SETQ TC1 (POLAR A0 (* 45 (/ pi 180)) 2))
(SETQ TC2 (POLAR A22 (* 45 (/ pi 180)) 2))
(SETQ TC3 (POLAR A18 (* 45 (/ pi 180)) 2))
(SETQ TC4 (POLAR A13 (* 45 (/ pi 180)) 2))
(command "cecolor" 3) ;绿色
(COMMAND "LINE" A0 A1 A11 A12 a16 a17 a20 a21 "c");外轮廓,以下为从左到右
(command "line" a2 a24 "")
(command "line" a4 a22 "")
(command "line" a5 a19 "")
(command "line" a7 a18 "")
(command "line" a8 a15 "")
(command "line" a10 a13 "")
(command "zoom" "e")
(command "_.bhatch" "p" "ansi31" 1 0 tc1 tc2 tc3 tc4 "")
(command "cecolor" 1) ;红色
(command "line" a25 a26 "")
(command "line" a27 a28 "")
(command "line" a29 a30 "")
(princ)