 - ;|;;文本型点对表编辑
- |
- (editlst '(("标签1" . "值1")
- ("标签2" . "值2")
- ("标签3" . "值3")
- ("标签4" . "值4")
- ("标签5" . "值5")
- ("标签6" . "值6")
- ("标签7" . "值7")
- ("标签8" . "值8")
- )
- )
- |;
- (defun editlst (lst / getdata fname F1 I lst1 dclid)
- (defun getdata ()
- (setq lst1 NIL
- I 1
- )
- (foreach n lst
- (setq LST1 (cons (cons (car n) (get_tile (strcat "KEY" (itoa I))))
- LST1
- )
- I (1+ I)
- )
- )
- )
- (setq fname (vl-filename-mktemp nil nil ".dcl"))
- (setq F1 (open fname "w"))
- (write-line
- "EditDCL:dialog{label=\"文本型点对表编辑 \";"
- F1
- )
- (write-line ":boxed_column{ " F1)
- (write-line ":row{\n:column{" F1)
- (setq I 1)
- (foreach n lst
- (write-line
- (strcat ":edit_box{label=\""
- (car n)
- "\";value=\""
- (cdr n)
- "\";key=\"KEY"
- (itoa I)
- "\";}"
- )
- F1
- )
- (if (= (rem i 5) 0)
- (write-line "}\n:column{" F1)
- )
- (setq I (1+ I))
- )
- (if (/= (rem (1- i) 5) 0)
- (write-line "}" F1)
- )
- (write-line "}\n}" F1)
- (write-line "ok_cancel;" F1)
- (write-line "}" F1)
- (close F1)
- (setq dclid (load_dialog fname))
- (vl-file-delete fname)
- (new_dialog "EditDCL" dclid)
- (action_tile "accept" "(getdata)(done_dialog 1)")
- (action_tile "cancel" "(done_dialog 0)")
- (start_dialog)
- (unload_dialog dclid)
- (if lst1
- (setq lst (reverse lst1))
- (setq lst lst)
- )
- )
- (defun c:xx-tt (/ ENT attlst)
- (prompt "***属性块编辑****")
- (while (setq ENT (CAR (entsel "\n 选择属性块:")))
- (setq attlst (editlst (GetAttributes ent)))
- (SetAttributes ent attlst)
- (princ "继续选择下一属性块")
- )
- (princ)
- )
怎么对齐??????
|