你原来写的sin和cos都是30度,为何改后就一个变成30度,一个变成15度?
还有circle命令,最后的空回车去掉- (defun c:rect03( / pt1 Dia d l1 l2 pt2 pt3 pt4 )
- (setvar "cmdecho" 0)
- (setvar "blipmode" 0)
- (setq pt1 (getpoint "请输入圆心坐标(0,0):"))
- (setq Dia (getreal "请输入直径D(10):"))
- (setq d (/ Dia 2))
- (setq l1 (/ d (sin (/ pi 6))))
- (setq l2 (* (cos (/ pi 6)) l1))
- (setq pt2 (list (- (car pt1) l2) (- (cadr pt1) d)))
- (setq pt3 (list (car pt1) (+ (cadr pt1) l1)))
- (setq pt4 (list (+ (car pt1) l2) (- (cadr pt1) d)))
- (command "circle" pt1 d)
- (command "pline" pt2 pt3 pt4 "c")
- (setvar "cmdecho" 1)
- (setvar "blipmode" 1)
- (prin1))
|