- 积分
- 354
- 明经币
- 个
- 注册时间
- 2002-11-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
(defun midpoint (p2 p3)
(list (/ (+ (car p2) (car p3)) 2) (/ (+ (cadr p2) (cadr p3)) 2)))
(defun go1 (p3 p2)
(list ((car p3) (cadr p2))))
(defun go2 (p2 p3)
(list ((car p2) (cadr p3))))
(defun c:t5 (/ p1 p2 p3 k p4 p5)
(setq p1 (getpoint "\n input p1"))
(setq p2 (getpoint "\n input p2"))
(setq p3 (polar p2 0 30))
(setq num (getint "\n input number"))
(command "pline" p1 p2 p3 "")
(command "text" "j" "mc" (polar (midpoint p2 p3) (/ pi 2) 10) "10" "" num )
(setq k 1)
(while (= k 1)
(setq p1 (getpoint "\n input p1"))
(setq p3 (getpoint "\n input p2"))
(setq num (+ num 1))
(setq ang (angle p2 p3))
(cond
((or (> ang (* (/ pi 4) 7)) (< ang (/ pi 4)) (and (> ang (* (/ pi 4) 3)) (< ang (* (/ pi 4) 5))))
(setq p4 (go1 p3 p2)))
((or (and (> ang (/ pi 4)) (< ang (* (/ pi 4) 3))) (and (< ang (* (/ pi 4) 7)) (> ang (* (/ pi 4) 6))))
(setq p4 (go1 p2 p3))))
(setq p5 (polar p4 0 30))
(command "pline" p1 p4 p5 "")
(command "text" "j" "mc" (polar (midpoint p4 p5) (/ pi 2) 10) "10" "" num )
(print "\n")
(setq k (getdist "\n do you want continue? input 1 mean yes; input 0 mean no"))))
这是一个标注数字用的程序,一个功能是输入一个数字,后面的数字自动加一,另一个主要功能是自动和原来的p2保持平行或垂直,主要修改p4的坐标达到.可是每次运行到求角度ang后就不行了!盼各位高手火眼金睛了! |
|