加载运行LISP程序后,对话框能显示但是点击OK后提示参数类型错误numberp: nil
求大神指点!!LISP程序如下:(defunc:dizuo();主函数(setqid(load_dialog"d:\\我的毕设\\程序\\diadizuo.dcl"));...
求大神指点!!
LISP程序如下:
(defun c:dizuo ();主函数
(setq id (load_dialog "d:\\我的毕设\\程序\\diadizuo.dcl"));装入对话框
(if (< id 0) (exit))
(setq sdt 0 x 50 y 50 r1 10 r2 20 l1 30 l2 5 l3 20);设置变量初值
(if (not (new_dialog "dizuo" id)) (exit));显示对话框
(set_tile "p_x" (rtos x 2 2)); 设置编辑框初始值,十进制,精确度小数点后两位
(set_tile "p_y" (rtos y 2 2))
(set_tile "r_1" (rtos r1 2 2))
(set_tile "r_2" (rtos r2 2 2))
(set_tile "l_1" (rtos l1 2 2))
(set_tile "l_2" (rtos l2 2 2))
(set_tile "l_3" (rtos l3 2 2))
(action_tile "accept" "(getdata) (done_dialog 1)");定义ok按钮的活动是执行getdata函数,然后以1为状态值关闭对话框
(action_tile "cancel" "(done_dialog -1)")
(setq sdt (start_dialog));显示对话框,将得到关闭对话框时的状态值
(unload_dialog id);卸载对话框文件
(if (> sdt 0)
(drawdizuo r1 r2 l1 l2 l3 p0 )
)
(princ)
)
(defun getdata()
(setq x (atof(get_tile "p_x")))
(setq y (atof(get_tile "p_y")))
(setq r1 (atof(get_tile "r_1")))
(setq r2 (atof(get_tile "r_2")))
(setq l1 (atof(get_tile "l_1")))
(setq l2 (atof(get_tile "l_2")))
(setq l3 (atof(get_tile "l_3")))
(setq p0 (list x y))
)
(defun drawdizuo(r1 r2 l1 l2 l3 p0)
(setvar "cmdecho" 0);关闭命令响应
(setvar "osmode" 0);关闭捕捉
。。。。。字数限制省略
) 展开
LISP程序如下:
(defun c:dizuo ();主函数
(setq id (load_dialog "d:\\我的毕设\\程序\\diadizuo.dcl"));装入对话框
(if (< id 0) (exit))
(setq sdt 0 x 50 y 50 r1 10 r2 20 l1 30 l2 5 l3 20);设置变量初值
(if (not (new_dialog "dizuo" id)) (exit));显示对话框
(set_tile "p_x" (rtos x 2 2)); 设置编辑框初始值,十进制,精确度小数点后两位
(set_tile "p_y" (rtos y 2 2))
(set_tile "r_1" (rtos r1 2 2))
(set_tile "r_2" (rtos r2 2 2))
(set_tile "l_1" (rtos l1 2 2))
(set_tile "l_2" (rtos l2 2 2))
(set_tile "l_3" (rtos l3 2 2))
(action_tile "accept" "(getdata) (done_dialog 1)");定义ok按钮的活动是执行getdata函数,然后以1为状态值关闭对话框
(action_tile "cancel" "(done_dialog -1)")
(setq sdt (start_dialog));显示对话框,将得到关闭对话框时的状态值
(unload_dialog id);卸载对话框文件
(if (> sdt 0)
(drawdizuo r1 r2 l1 l2 l3 p0 )
)
(princ)
)
(defun getdata()
(setq x (atof(get_tile "p_x")))
(setq y (atof(get_tile "p_y")))
(setq r1 (atof(get_tile "r_1")))
(setq r2 (atof(get_tile "r_2")))
(setq l1 (atof(get_tile "l_1")))
(setq l2 (atof(get_tile "l_2")))
(setq l3 (atof(get_tile "l_3")))
(setq p0 (list x y))
)
(defun drawdizuo(r1 r2 l1 l2 l3 p0)
(setvar "cmdecho" 0);关闭命令响应
(setvar "osmode" 0);关闭捕捉
。。。。。字数限制省略
) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询