本帖最后由 vectra 于 2013-7-16 17:00 编辑
- (defun c:ys1 ()
- (setvar "CMDECHO" 0)
- (if (and
- (setq pt1 (getpoint "\nFirst Point ?? :"))
- (setq pt2 (getpoint pt1 "\nSecond Point ?? :"))
- )
- (progn
- (setq xx (- (car pt2) (car pt1))
- yy (- (cadr pt2) (cadr pt1))
- num (/ yy 1.0 xx)
- str (rtos (* 100 num) 2 1)
- )
- (setq dst (distance pt1 pt2)
- str1 (rtos dst 2 1) ;; FIX 1
- dtt (strcat "DN300 L=" str1 "m i=" str "%")
- a1 (angle pt1 pt2)
- a2 (* (/ a1 pi) 180)
- ptt (polar pt1 a1 (/ dst 2))
- )
- (command "text" "j" "bc" ptt 2.5 a2 dtt) ;; FIX2
- )
- )
- (princ)
- )
FIX1 多余的括号删除
FIX2 command放置的位置有误
|