tzbm123456 发表于 2018-4-27 07:27:31

Lisp如何驱动DCL对话框

本帖最后由 tzbm123456 于 2018-4-27 11:42 编辑

Lisp如何驱动DCL对话框:
Lisp文件:
(defun c:work_1()
      (setq dlg_file (getfiled "选择要预览的对话框所在文件" "C:\\Documents and Settings\\czj\\My Documents\\autolisp\\" "DCL" 2))
      (if (= dlg_file nil) (exit))
      (setq dlg_name (getstring "\n对话框名称:"))
      (if (= dlg_name "") (exit))
      (setq dlg_id (load_dialog dlg_file))
      (if (< dlg_id 0) (exit))
      (setq std 0)
      (if (not (new_dialog dlg_name dlg_id)) (exit))
      (action_tile "accept" "(done_dialog 1)")
      (action_tile "aceept" "(done_dialog 0)")
      (setq std (start_dialog))
      (unload_dialog dlg_id)
      (cond
                  ((= std 1) (princ "确定"))
                ((= std 0) (princ "取消"))
      )
      (princ)
)


tzbm123456 发表于 2018-4-27 07:28:27

本帖最后由 tzbm123456 于 2018-4-27 11:43 编辑

DCL文件:
shezhi:dialog{
      label="ZLQ系列数控自动编程系统";
      :text{
                label="参数设置:";
                alignment=left;
      }

      :edit_box{
                label="引入线长度:";
                edit_width=10;
      }
      :edit_box{
                label="割缝补偿:";
                edit_width=10;
      }
      spacer_1;
      :toggle{
                label="手动添加不封闭层轮廓引入线";
      }
      spacer_1;
      ok_cancel;
}

页: [1]
查看完整版本: Lisp如何驱动DCL对话框