求助通过面板管理lisp文件
本帖最后由 流_星 于 2013-4-21 13:42 编辑dcl文件
;
fil:dialog{label="辅助设计面板";
:row{
:boxed_column{label="数字计算"; width=5;
:button{label="加法计算"; key="jf";width=5; is_default = true;}
:button{label="减法计算"; key="jian";width=5;is_default = true;}
:button{label="乘法计算"; key="cf";width=5; is_default = true;}
:button{label="除法计算"; key="chu";width=5; is_default = true;}
}
}
ok_cancel;}
然后通过lisp文件,管理文件
点击加法计算,读取加法计算.lsp文件。
(defun c:HH ()
(if (> (setq dcl_id (load_dialog (findfile "drawn.dcl"))) 0) (progn
(if (new_dialog "drawn" dcl_id "") (progn
(action_tile "jf" "(done_dialog 1)")
(action_tile "jian" "(done_dialog 2)")
(action_tile "cf" "(done_dialog 3)")
(action_tile "chu""(done_dialog 4)")
(setq re (start_dialog))
(princ "\n无法显示对话框!")
)
)
(unload_dialog dcl_id)
)
(princ "\n无法加载对话框!")
)
(cond
((= re 1) (load "C:/CSRCAD/TOOL/加法计算") (c:Jf))
((= re 2) (load "C:/CSRCAD/TOOL/减法计算") (c:jian))
((= re 3) (load "C:/CSRCAD/TOOL/乘法计算") (c:cf))
((= re 4) (load "C:/CSRCAD/TOOL/除法计算") (c:chu))
)
(princ)
)
对吗;调试出错
请高手帮个忙,大家帮帮忙
Dcl 檔名要為.drawn.dcl
fil:dialog{label="辅助设计面板"; 改為
drawn:dialog{label="辅助设计面板";
然後你調用的LISP 路徑要在.C:/CSRCAD/目錄下. 谢谢我试试 语句顺序有误。下面是改过的。
(defun c:HH ()
(if (> (setq dcl_id (load_dialog (findfile "drawn.dcl"))) 0) (progn
(if (new_dialog "drawn" dcl_id "") (progn
(action_tile "jf" "(done_dialog 1)")
(action_tile "jian" "(done_dialog 2)")
(action_tile "cf" "(done_dialog 3)")
(action_tile "chu""(done_dialog 4)")
(setq re (start_dialog))
)
(princ "\n无法显示对话框!")
)
(unload_dialog dcl_id)
)
(princ "\n无法加载对话框!")
)
(cond
((= re 1) (load "C:/CSRCAD/TOOL/加法计算") (c:Jf))
((= re 2) (load "C:/CSRCAD/TOOL/减法计算") (c:jian))
((= re 3) (load "C:/CSRCAD/TOOL/乘法计算") (c:cf))
((= re 4) (load "C:/CSRCAD/TOOL/除法计算") (c:chu))
)
(princ)
)
非常感谢ZZXXQQ 记忆先前的选择(defun c:HH ()
(setq re 0)
(if (> (setq dcl_id (load_dialog (findfile "drawn.dcl"))) 0) (progn
(if (new_dialog "drawn" dcl_id "") (progn
(cond
((= re 1) (mode_tile "jf" 2))
((= re 2) (mode_tile "jian" 2))
((= re 3) (mode_tile "cf" 2))
((= re 4) (mode_tile "chu" 2))
)
(action_tile "jf" "(done_dialog 1)")
(action_tile "jian" "(done_dialog 2)")
(action_tile "cf" "(done_dialog 3)")
(action_tile "chu""(done_dialog 4)")
(setq re (start_dialog))
)
(princ "\n无法显示对话框!")
)
(unload_dialog dcl_id)
)
(princ "\n无法加载对话框!")
)
(cond
((= re 1) (load "C:/CSRCAD/TOOL/加法计算") (c:Jf))
((= re 2) (load "C:/CSRCAD/TOOL/减法计算") (c:jian))
((= re 3) (load "C:/CSRCAD/TOOL/乘法计算") (c:cf))
((= re 4) (load "C:/CSRCAD/TOOL/除法计算") (c:chu))
)
(princ)
)
同步学习中……………… 这是个好东西 感谢楼主分享下载试试! 这个源码真好,感谢分享!
页:
[1]
2