- (DEFUN C:T1 ()
- (SETQ P1 (GETPOINT"\n请指定起点"))
- (setq pd(getreal"\n请指输入坡度"))
- (SETQ P2 (POLAR (POLAR P1 0 1) (+ (* 0.5 PI)) PD))
- (SETQ LOOP T)
- (SETQ E (entmakeX (list '(0 . "LINE") (cons 10 p1) (cons 11 p2))))
- (WHILE LOOP
- (setq code (grread T 8)
- PT (CADR CODE)
- )
- (COND
- ((= (car code) 5)
- (IF E(ENTDEL E))
- (SETQ P3 (INTERS P1 P2 PT (POLAR PT (+ (* 0.5 PI)) 100) NIL)
- E (entmakeX (list '(0 . "LINE") (cons 10 p1) (cons 11 p3)))
- )
- )
- ;;; 鼠标移动
- ((OR (= (car code) 3) (= (car code) 11)) (SETQ LOOP NIL)))
- ;;; 鼠标左键
- )
- (PRINC )
- )
没有捕捉其实没啥用,动态是没办法精准的 |