帮助中的例子,你先看看吧,也不知道你会哪些,所以不好教。看着例子慢慢理解吧。本站CAD下载中有中文版的帮助文件下载
-
- hidedcl : dialog
- { label="Hide Example";
- : column
- { : text
- { key="message";
- label="Click PickMe to pick a point";
- fixed_width=true;
- fixed_height=true;
- alignment=centered;
- }
- :row
- { ok_only;
- :retirement_button
- { label = "PickMe";
- key = "hide";
- mnemonic = "H"; }}}}控制对话框的函数显示窗口,直到用户选择了“OK”或关闭窗口为止。如果用户选择“PickMe”,代码将隐藏对话框并提示用户选择一点。下列 AutoLISP 代码控制该对话框:(defun c:hidedcl (/ dcl_id what_next cnt)
- (setq dcl_id (load_dialog "hidedcl.dcl")) ;加载对话框
- (setq what_next 2)
- (setq cnt 1)
- (while (>= what_next 2) ;开始显示循环
- (if (null (new_dialog "hidedcl" dcl_id)) ;初始化对话框
- (exit) ;如果返回 nil 则退出
- ); endif ; 设置按钮被按下后执行的动作。每个按钮都调用 done_dialog
- ; 关闭对话框
- ; 每个按钮都将一个特定的状态代码与 done_dialog 相关联, ; 并且该状态代码由 start_dialog 返回。
- (action_tile "accept" "(done_dialog 1)") ;设置 OK 的动作
- (action_tile "hide" "(done_dialog 4)") ;设置 PickMe的动作
- (setq what_next (start_dialog)) ;显示对话框
- ;
- (cond
- ((= what_next 4) ;提示用户
- (getpoint "\npick a point") ;拾取 pt
- )
- ((= what_next 0)
- (prompt "\nuser cancelled dialog")
- )
- )
- )
- (unload_dialog dcl_id) (princ))
|