明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1164|回复: 1

求救 关于对话框的问题

[复制链接]
发表于 2005-5-22 20:44 | 显示全部楼层 |阅读模式
我想实现对话框里面输入的值的获取,然后用这些值画个圆,可是在加载时它说;“错误: 输入的列表有缺陷”我就不知道哪里的列表错了 怎么错的 ????请高手指点。我用的时CAD2005 。 yuan:dialog
{
label="绘制圆";
Initial_focus="X";
:row{
:boxed_column{label="几何数据";
:edit_box{label="圆心&X(mm):";
edit_width=8;
key="X";
value="50";
}
:edit_box{label="圆心&Y(mm):";
edit_width=8;
mnemonic="Y";
key="Y";
value="50";
}
:edit_box{label="半径&R(mm):";
edit_width=8;
mnemonic="Y";
key="R";
value="10";
}
}
}
ok_cancel;
} 以上是对话框的设置 (defun act()
(setq x (atof(get_tile "X")))
(setq y (atof(get_tile "Y")))
(setq r (atof(get_tile "R")))
)
(defun c:circ(/ x y r id)
(setq sdt 0)
(setq id (load_dialog "C8_3"))
(if (< id 0) (exit))
(setq X 50 Y 50 R 25)
(if (not (new_dialog "yuan" id)) (exit))
(set_tile "X" (rtos X 2 2))
(set_tile "Y" (rtos Y 2 2))
(set_tile "R" (rtos R 2 2)) (action_tile "accept" "(act)(done_dialog 1)")
(action_tile "cancel" "(done_dialog -1)") (setq sdt (start_dialog))
(unload_dialog id)
(if (> sdt 0)
(command "circle" (list x y) r)
(princ)
) 以上是主程序
发表于 2005-5-22 21:19 | 显示全部楼层
  1. ;;主程序的最后少一个右括号!(defun act ()
  2.    (setq  x (atof (get_tile "X"))
  3.   y (atof (get_tile "Y"))
  4.   r (atof (get_tile "R"))
  5.    )
  6. )
  7. (defun c:circ (/ x y r id)
  8.    (setq  sdt 0
  9.   id   (load_dialog "C8_3")
  10.    )
  11.    (if (< id 0) (exit))
  12.    (setq  X 50
  13.   Y 50
  14.   R 25
  15.    )
  16.    (if (not (new_dialog "yuan" id))(exit))
  17.    (set_tile "X" (rtos X 2 2))
  18.    (set_tile "Y" (rtos Y 2 2))
  19.    (set_tile "R" (rtos R 2 2))
  20.    (action_tile "accept" "(act)(done_dialog 1)")
  21.    (action_tile "cancel" "(done_dialog -1)")
  22.    (setq sdt (start_dialog))
  23.    (unload_dialog id)
  24.    (if (> sdt 0)
  25.        (command "circle" (list x y) r)
  26.        (princ)
  27.    )
  28. )
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-12 03:18 , Processed in 0.153484 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表