[求助]我的一个画图程序,不没有办法正确转换数据
本帖最后由 作者 于 2003-4-27 19:36:11 编辑提示说圆弧半径不能为零,估计是atof的问题,但又不知到怎么修改,希望哪位朋友能指点指点,或者能给点意见
(defun c:kkdq();开口垫圈
(new_dialog "kkdqdlg" (load_dialog "kkdqdcl"))
(start_image "kkdq")
(slide_image 0 0 (dimx_tile "kkdq") (dimy_tile "kkdq") "kkdq")
(end_image)
(action_tile "b" "(setq c1 $value)")
(action_tile "d" "(setq c2 $value)")
(action_tile "h" "(setq c3 $value)")
(action_tile "c" "(setq c4 $value)")
(action_tile "alf" "(setq c5 $value)")
(action_tile "x" "(setq x1 $value)")
(action_tile "y" "(setq y1 $value)")
(start_dialog)
(if (= 0 (start_dialog))
(progn (setq b (atof "c1")
d (atof "c2")
h (atof "c3")
c (atof "c4")
alf (atof "c5")
x (atof "x1")
y (atof "y1")
)
(setq p0 (list x y))
)
)
(setq m (sqrt (- (* (* 0.5 d) (* 0.5 d)) (* (* 0.5 b) (* 0.5 b))));m=sqr(0.5d*0.5d-0.5b*0.5b)
n (sqrt (- (* (- (* 0.5 d) c) (- (* 0.5 d) c)) (* (* 0.5 b) (* 0.5 b))))
);n=sqr((0.5d-2)*(0.5d-2)-0.5b*0.5b)
(setq p1 (polar p0 (+ pi alf) (* 0.5 b))
p2 (polar p0 alf (* 0.5 b))
p3 (polar p1 (+ (* 1.5 pi) alf) m)
p4 (polar p2 (+ (* 1.5 pi) alf) m)
p5 (polar p0 (+ (* 0.5 pi) alf) (- (* 0.5 d) c))
p6 (polar p5 (+ (* 0.5 pi) alf) c)
p7 (polar p3 (+ (* 0.5 pi) alf) (- m n))
p8 (polar p4 (+ (* 0.5 pi) alf) (- m n))
)
(command "arc"p2"c"p0 p1);程序在这里出错中断
(command "arc"p4 p6 p3)
(command "arc"p8 p5 p7)
(command "line"p1 p3"")
(command "line"p2 p4"")
)
再把对话框程序贴上来吧
也许还与从对话框输入的数据有关
要看对话框文件
页:
[1]