- (defun c:tt(/ dcl_xssl_dia getpt makexssldcl xy)
- (defun makexssldcl (/ lst_str str file f)
- (setq lst_str '(
- "xssl:dialog {"
- " label = \"面板消失示例\" ;"
- " :column {"
- " :row {"
- " :button {"
- " key = \"b1\" ;"
- " label = \"拾取坐标\" ;"
- " }"
- " :edit_box {"
- " alignment = top ;"
- " edit_width = 20 ;"
- " is_enabled=false;"
- " key = \"e1\" ;"
- " }"
- " }"
- " }"
- " :button {"
- " is_cancel = true ;"
- " key = \"cancel\" ;"
- " label = \"确定\" ;"
- " }"
- "}"
- )
- )
- (setq file (vl-filename-mktemp "DclTemp.dcl"))
- (setq f (open file "w"))
- (foreach str lst_str
- (princ "\n" f)
- (princ str f)
- )
- (close f)
- file
- )
- (defun cs(a b c d e f /)
- (print (list a b c d e f ))
- )
-
- (defun getpt( /)
- (setq
- pt(getpoint "\n指定点:")
- x(rtos (car pt)2 3)
- y(rtos (cadr pt)2 3)
- xy(strcat x","y)
- )
- (command "circle" pt 50)
- (setq ssa(ssadd (entlast) ssa))
- (set_tile "e1" xy)
- (dcl_xssl_dia)
- )
- (setq ssa(ssadd))
- (defun dcl_xssl_dia()
- (setq xssl_dia(makexssldcl))
- (setq dcl_id(load_dialog xssl_dia))
- (new_dialog "xssl" dcl_id"" (cond (jypt) ( '(-1 -1) )))
- (or xy (setq xy ""))
- (set_tile "e1" xy)
- (action_tile "cancel""(setq jypt(done_dialog -1))")
- (action_tile "b1""(cs $key $VALUE $DATA $REASON $X $Y)(setq jypt(done_dialog 1))")
- (setq id(start_dialog))
- (unload_dialog dcl_id)
- (vl-file-delete xssl_dia)
- (cond
- ((= id 1)
- (getpt)
- )
- ((= id -1)
- (vl-cmdf "erase" ssa "")
- (princ"\n退出程序!")
- )
- )
- )
- (dcl_xssl_dia)
- (princ)
- )
|