- ;对话框程序开始:
- (defun ngc-dcl()
- (setq Dcl_File (vl-filename-mktemp nil nil ".Dcl"))
- (setq f_dcl (open Dcl_File "w"))
- (write-line "JLTC:dialog{" f_dcl)
- (write-line " label="立弘-图层设定";" f_dcl)
- (write-line " :boxed_radio_column{" f_dcl)
- (write-line " label="新建图层";" f_dcl)
- (write-line " :radio_button{label="安装图层";key="rb11";}" f_dcl)
- (write-line " :radio_button{label="加工图层";key="rb12";}" f_dcl)
- (write-line " :radio_button{label="深化图层";key="rb13";}" f_dcl)
- (write-line " }" f_dcl)
- (write-line " spacer_1;" f_dcl)
- (write-line " ok_cancel;" f_dcl)
- (write-line " }" f_dcl)
- (close f_dcl)Dcl_File)
- ;;主程序开始:
- (defun c:tt ()
- (setq dcl_id (load_dialog (setq Dcl_File (ngc-dcl))))
- (vl-file-delete Dcl_File)
- (SETQ CHK 0)
- (NEW_DIALOG "JLTC" DCL_ID)
- (ACTION_TILE "accept" "(SETQ CHK 1)(S_PGON)(DONE_DIALOG)")
- (START_DIALOG)
- (UNLOAD_DIALOG DCL_ID)
- (cond ((= dd 1) (sub_achk_layer))
- ((= dd 2) (sub_jchk_layer))
- ((= dd 3) (sub_schk_layer))
- )
- (PRINC)
- )
- (DEFUN S_PGON ()
- (COND ((= (GET_TILE "rb11") "1") (SETQ dd 1))
- ((= (GET_TILE "rb12") "1") (SETQ dd 2))
- ((= (GET_TILE "rb13") "1") (SETQ dd 3))
- )
- )
- (defun sub_achk_layer ()
- (alert "\n001")
- )
- (defun sub_jchk_layer ()
- (alert "\n002")
- )
- (defun sub_schk_layer ()
- (alert "\n003")
- )
测试后能识别启动命令,自己替换自定义函数部分,我换了触发条件,可以参考 |