几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(AutoLISP) (http://www.dimcax.com/hust/forumdisplay.php?f=178)
-   -   [求助]请问这个程序怎么错了 (http://www.dimcax.com/hust/showthread.php?t=11325)

yang686526 2009-04-26 02:50 PM

[求助]请问这个程序怎么错了
 
[求助]请问这个程序怎么错了
www.dimcax.com
[求助]请问这个程序怎么错了
(defun c:rect()
(setq dcl_id (load_dialog "d:\\练习"))

(new_dialog "rect" dcl_id)
(set_tile "rect_w" "50.0")
(set_tile "rect_h" "25.0")
(action_tile "accept" "(s_rect)(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(setq pt_0 (getpoint "\nselect rectange lower left point:"))
(setq pt_1 (polar pt_0 0 tmp_w) pt_2 (polar pt_1 (/pi 2) tmp_h) pt_3 (polar
pt_2 pi tmp_h))

(command "pline" pt_0 pt_1 pt_2 pt_3 "c")
(princ)
)
(defun c:s_rect() (setq tmp_w (abs(atof(get_tile "rect_w"))) tmp_h (abs(atof(get_tile
"rect_h"))))
)
rect:dialog
{ label="rectangle";
:text //文字元件
{label="rectanglewidth:"; //元件的屬性
}
:edit_box{ label="rectangle width:";
key="rect_w" ;
edit_limit=16;
edit_width=10;
fixed_width=true;
value="50.0";
}
:edit_box
{ label="rectangle height :";
key="rect_h";
edit_limit=16;
edit_width=10;
fixed_width=true;
value="25.0";
}
ok_only;
}
加载后出现参数类型错误 numberp , 有时还提示 程序多加了一个闭括号,这是什么原因啊
可这都是书上的例子我拿来学的,怎么就是不成功,实在没办法,希望高手多教教我。
d
对话框文件必须配合 rect.lsp 文件才能显示相应对话框。
文件预览:
( .79 kb,已被下载 4 次 )
通过工具菜单->加载应用程序 可加载该程序,然后可直接在命令行输入相关命令运行。如需要每次启动时均加载该程序,则可以将该文件放在启动组中。
文件预览:
修改了一下,能运行了,你对照原来程序看看.
change your life style.
d
谢谢你了
我也是初学
以后有什么问题希望能给予各帮助,真的非常感谢!!!
d


所有的时间均为北京时间。 现在的时间是 08:41 PM.