代码改变世界

AutoLISPDCL对话框设计

2011-03-30 09:30  精诚所至 金石为开  阅读(633)  评论(0编辑  收藏  举报

AutoLISPDCL对话框设计,代码如下。

(defun c:viewdcl()
  (if (null dcl_pt)
    (setq dcl_pt '(-1 -1))
    )
  (setq dcl_file (getfiled "打开DCL文件" "" "DCL" 2))
  (princ "DCL文件名:") (princ dcl_file)
  (setq dia_name (getstring "\nDialog对话框名:"))
  (if (= dia_name "") (exit))
  (setq dcl_id (load_dialog dcl_file))
  (new_dialog dia_name dcl_id)
  (action_tile "accept" "(setq dcl_pt (done_dialog 1))")
  (action_tile "cancel" "(done_dialog 0)")
  (setq dd(start_dialog))
  (cond ((= dd 1) (princ "\n确定<Ok>!!!"))
    ((= dd 0) (princ "\n取消<Cancel>!!!"))
    )
  (prin1)
  )
(prompt "------VIEWDCL对话框设计------")
(prin1)

代码完。