明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1858|回复: 5

哪里出问题了

[复制链接]
发表于 2004-8-30 20:49:00 | 显示全部楼层 |阅读模式
LSP文件 (defun c:boxline ()
(dcl_dia)
(prin1)
)
(defun dcl_dia ()
(setq dcl_id (load_dialog "dia"))
(new_dialog "dia" dcl_id)
(set_tile "edit_p1" "0,0")
(set_tile "edit_p2" "100,100")
(action_tile "accept" "(ok_dia) (done_dialog 1)")
(start_dialog)
)
(defun ok_dia ()
(Setq p1 (get_tile "edit_p1"))
(Setq p2 (Get_tile "edit_p2"))
(command "line" p1 p2 "")
) DCL文件 dia:dialog{
label="绘声绘色";
:edit_box{
label="first point:";
key="edit_p1";
edit_width=6;
}
:edit_box{
label="end point:";
key="edit_p2";
edit_width=6;
}
ok_cancel;
} 一运行就死机,怎么搞的,今天干什么也不顺!!!!!
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2004-8-31 07:07:00 | 显示全部楼层
典型dcl错误,对话框关闭前执行COMMAND. (defun dcl_dia ()
(setq dcl_id (load_dialog "dia"))
(new_dialog "dia" dcl_id)
(set_tile "edit_p1" "0,0")
(set_tile "edit_p2" "100,100")
(action_tile "accept" "(ok_dia) (done_dialog 1)")
(IF (= (start_dialog) 1)(command "line" p1 p2 ""))
)
(defun ok_dia ()
(Setq p1 (get_tile "edit_p1"))
(Setq p2 (Get_tile "edit_p2"))
)
 楼主| 发表于 2004-8-31 08:29:00 | 显示全部楼层
谢谢!昨天我把它改成这样,和你的那句(IF (= (start_dialog) 1)(command "line" p1 p2 ""))效果是不是一样的啊? (defun dcl_dia ()
(setq dcl_id (load_dialog "dia"))
(new_dialog "dia" dcl_id)
(set_tile "edit_p1" "0,0")
(set_tile "edit_p2" "100,100")
(action_tile "accept" "(ok_dia) (done_dialog 1)")
[I](start_dialog)
(command "line" p1 p2 ""))[/I]
)
(defun ok_dia ()
(Setq p1 (get_tile "edit_p1"))
(Setq p2 (Get_tile "edit_p2"))
)
发表于 2004-8-31 08:30:00 | 显示全部楼层
你选择取消试试,看效果是不是一样
发表于 2004-8-31 14:51:00 | 显示全部楼层
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)") (setq what (start_dialog))
(cond ((= what 1) (AD-MAIN))) 点击确定时执行函数 (AD-MAIN) 如果点击取消就不会执行
 楼主| 发表于 2004-9-1 08:25:00 | 显示全部楼层
谢谢各位
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-18 19:54 , Processed in 0.158335 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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