BDYCAD 发表于 2003-12-22 16:34:00

用start命令運行其它程序在LISP中的應用.

程序是今年春季寫的找出來和大家分享. 我目前常常用的. 程序寫的不好還望各位多多指點更進. 謝謝 : )

;;;      常用管理電腦工具.LSP   
;;; Program make by : BDYCAD
;;; date : 2003-04-08            
;;; 對話框文件<usera012.DCL>      
(defun c:ee (/ DD)
(defun dcl-file-autowrite(/ findf neew file)
(setq findf(findfile "acad.dcl"))
(setq neew (strcat (substr findf 1 (- (strlen findf) 8)) "usera012.DCL"))
(setq file (open neew "w"))
(princ "\ncadbdy01:dialog{//C:eee的對話框程序文件" file)
(princ"\nlabel=\"   BDYCAD 外 部 管 理 工 具   \";" file)
(princ"\n:row{" file)
(princ"\n: row {" file)
(princ"\n:boxed_column {" file)
(princ"\n:button{label=\"Open scan instrument\";key=\"a\";edit_width=10;}" file)
(princ "\n:button{label=\"Open resource management\";key=\"b\";edit_width=10;}"file)
(princ "\n:button{label=\"Open calculate\";key=\"c\";edit_width=10;}"file)
(princ "\n:button{label=\"Open JinSan Fast translate\";key=\"d\";edit_width=10;}"file)
(princ "\n:button{label=\"Open Notebook\";key=\"e\";edit_width=10;}}"file)
(princ "\n:boxed_column {"file)
(princ "\n:button{label=\"Coreldrw\";key=\"f\";edit_width=10;}"file)
(princ "\n:button{label=\"Open Excel\";key=\"g\";edit_width=10;}"file)
(princ "\n:button{label=\"Open computer C:\";key=\"h\";edit_width=10;}"file)
(princ "\n:button{label=\"Open computer D:\";key=\"i\";edit_width=10;}"file)
(princ "\n:button{label=\"Open computer E:\";key=\"j\";edit_width=10;}}}}"file)
(princ "\n: button { label = \"&E 不 玩 了 喔\"; key = \"tt\";is_cancel=true; width = 10;}}"file)
(close file))
(dcl-file-autowrite)
(new_dialog "cadbdy01" (load_dialog "usera012.DCL"))
(action_tile "a" "(done_dialog 1 )")
(action_tile "b" "(done_dialog 2 )")
(action_tile "c" "(done_dialog 3 )")
(action_tile "d" "(done_dialog 4 )")
(action_tile "e" "(done_dialog 5 )")
(action_tile "f" "(done_dialog 6 )")
(action_tile "g" "(done_dialog 7 )")
(action_tile "h" "(done_dialog 8 )")
(action_tile "i" "(done_dialog 9 )")
(action_tile "j" "(done_dialog 10 )")
(action_tile "tt" "(done_dialog 8888)")
(SETQ DD (START_DIALOG))
(COND
    ((= DD 1) (command ".start" "MiraScan"))
    ((= DD 2) (command ".START" "EXPLORER"))
    ((= DD 3) (command ".START" "CALC"))
    ((= DD 4) (command ".START" "jxky"))
    ((= DD 5) (command ".START" "Notepad"))
    ((= DD 6) (command ".start" "CorelDRAW 11"))
    ((= DD 7) (command ".START" "EXCEL"))
    ((= DD 8) (command ".START" "C:"))
    ((= DD 9) (command ".START" "D:"))
    ((= DD 10) (command ".START" "E:"))
    ((= DD 8888) (progn (princ "\n退出程序功能") (exit)))
    (T (ALERT "缺少對話框安全退出程序操作系統...。"));; 這句可能沒有機會出現呢.
    )
(PRIN1))
(princ "\nEE.LSP以加載, 在命令行輸入EE執行功能....")

li809 发表于 2005-2-22 23:07:00

不懂怎么用

它山之石 发表于 2005-2-23 13:56:00

有点意思,谢谢共享

ZZXXQQ 发表于 2005-2-24 01:21:00

无对话框代码,无法执行!

BDYCAD 发表于 2005-2-24 08:36:00

对话框代码以写到LISP里面 看看 dcl-file-autowrite 涵数

用户3766035971 发表于 2015-1-23 22:06:52

有点意思,谢谢共享

自贡黄明儒 发表于 2015-1-26 16:55:47

new_dialog之前少了一句(setq dclid (load_dialogfindf))
   
页: [1]
查看完整版本: 用start命令運行其它程序在LISP中的應用.