- 积分
- 3961
- 明经币
- 个
- 注册时间
- 2005-6-29
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我用LISP写的幻灯片及DWG文件批处理脚本生成器,总觉不对请指教!!!
(defun C:SSCR () (setq filename "C:\\jc\\sscr.dcl") (if (not (findfile filename)) (progn (alert (strcat "Cann't find file:\n" filename)) (exit 0) ) ) (setq fIndex (load_dialog filename)) (setq filename "jdh.scr") (setq cxm "ss") (setq hdcl_flags "0") (if (new_dialog "scr" fIndex) (progn (mode_tile "btn_run" 1) (set_tile "ed_sla" filename) ;(mode_tile "ed_sla" 2) ;(mode_tile "ed_sla" 3) (set_tile "ed_jla" cxm)
(action_tile "btn_f" "(getfilename)") (action_tile "btn_w" "(getfilw)") (action_tile "ed_sla" "(setfilename)") (action_tile "rdi_txcl" "(txcll)") (action_tile "rdi_hdcl" "(hdcl)") (action_tile "btn_run" "(get_ctl)(done_dialog 1)") (action_tile "btn_exit" "(done_dialog)") (setq dowhat (start_dialog)) (if (eq dowhat 1) (progn ;(princ "1234567") (jtxcl) ) ) ) ) ) ;; (defun jtxcl () (setq qq (vl-filename-directory dfil)) (setq bbb (vl-directory-files qq)) (setq bbb (cdr (cdr bbb))) (setq ml (open scr "w")) (setq sm (length bbb)) (princ ";;目录共有文件 " ml) (prin1 sm ml) (princ "\n" ml) (setq i 0) (repeat sm (setq mb (nth i bbb)) (setq dwg (strcat "*" "DWG")) (setq dxg (strcat "*" "dwg")) (if (or (wcmatch mb dwg) (wcmatch mb dxg)) (progn (setq mb1 (strcat qq "\\" mb)) (princ "open " ml) (princ mb1 ml) (princ "\n" ml) (if (eq txcl "1") (progn (princ cxm ml) (princ "\n" ml) (princ "qsave" ml) ) ) (if (eq hdcl "1") (progn (princ "mslide" ml) (princ "\n" ml) (princ " " ml) ) ) (princ "\n" ml) (princ "close" ml) (princ "\n" ml) ) ) (setq i (1+ i)) ) (close ml) (startapp "notepad.exe" scr) ) ;;;;;;; (defun getfilename () (setq filename (getfiled "jdh:<选择脚本>" "c:\\" "scr" 1)) (if filename (progn (set_tile "ed_sla" filename) ;(setq txcl (get_tile "rdi_txcl")) ;(setq hdcl (get_tile "rdi_hdcl")) (setq cxm (get_tile "ed_jla")) (setq scr (get_tile "ed_sla")) (mode_tile "btn_run" 0) ) ) ) ;;end def (defun getfilw () (setq dfil (getfiled "选择所要处理文件夹任一文件" "D:/" "*" 4)) (if filename (progn (set_tile "ed_swz" dfil) (setq dfil (get_tile "ed_swz")) ) ) ) (defun setfilename() ;;(mode_tile "ed_jla" 3) (setq filename (get_tile "ed_sla")) ) (defun txcll () (setq hdcl_flags "1") (mode_tile "rdi_txcl" 0) (mode_tile "ed_jla" 3) ) (defun hdcl () (setq hdcl_flags "0") (mode_tile "rdi_txcl" 1) (mode_tile "ed_jla" 1) );;end def (defun get_ctl () (setq txcl (get_tile "rdi_txcl")) (setq hdcl (get_tile "rdi_hdcl")) )
------------------------------------------
scr:dialog{ label="JDH:<脚本生成器>"; :row{ :boxed_column { label="参数设置:"; :row{ :edit_box { label="处理DWG文件位置:"; key="ed_swz"; } :button{ label="定位"; key="btn_w"; width=8; fixed_width=true; } } :edit_box { label="加载程序名称:"; key="ed_jla"; } :row{ :edit_box { label="脚本名称及位置:"; key="ed_sla"; } :button{ label="---"; key="btn_f"; width=8; fixed_width=true; } } :radio_row{ :radio_button{ label="生成原图形处理脚本!"; key="rdi_txcl"; value=1; } :radio_button{ label="单个幻灯片生成脚本!"; key="rdi_hdcl"; } } :text{ label=" 河南省测绘工程院"; } }//end column// :column{ :column{ :button{ label="处理"; key="btn_run"; width=12; is_default=true; fixed_width=true; } :button{ label="退出"; key="btn_exit"; width=12; fixed_width=true; } spacer_1; } :text{ } :text{ } :text{ } } }//end row }//end dialog |
|