 - (defun C:MM ()
- (vl-load-com)
- (setq texta "")
- (while
- (progn
- (setq tmp-dcl-file-name (vl-filename-mktemp nil nil ".dcl"))
- (setq dcl_file (open tmp-dcl-file-name "w"))
- (foreach x
- '(
- "ZW:dialog {"
- "label = "测试";"
- ":edit_box { key = "AAA";}"
- ":button { label = "拾取"; key = "CCC"; }"
- "ok_cancel;"
- "}"
- )
- (write-line x dcl_file)
- )
- (close dcl_file)
- (setq dcl_id (load_dialog tmp-dcl-file-name))
- (vl-file-delete tmp-dcl-file-name)
- (if (not (new_dialog "ZW" dcl_id))(exit))
- (set_tile "AAA" texta)
- (action_tile "CCC" "(done_dialog 2)")
- (action_tile "accept" "(done_dialog 1)")
- (action_tile "cancel" "(done_dialog 0)")
- (setq AA (start_dialog))
- (unload_dialog dcl_id)
- (cond
- ((= AA 2)(setq texta (YYDS)))
- (T nil)
- )
- )
- )
- (princ)
- )
- (defun YYDS ()
- (setq ent (entsel "\n选择一个文字对象: "))
- (if ent
- (progn
- (setq data (entget (car ent)))
- (cdr (assoc 1 data))
- )
- )
- )
|