73哥函数,文字反转
(defun c:wzfz ( / ent lst i ii zhc ent1 lsta)
(setq lsta (ssget '((0 . "text"))))
(setq ii 0)
(defun str->chrs(str / ac i zhc)
(setq a(vl-string->list str))
(while a
(if(<(car a)129)(setq c(cons(chr(car a))c)a(cdr a))
(setq c(cons(strcat(chr(car a))(chr(cadr a)))c)a(cddr a))))
(reverse c)
(setq i 0)
(setq zhc "" )
(repeat (length (reverse (reverse c)))
(setq zhc (strcat zhc (nth i (reverse (reverse c))) ))
(setq i (1+ i))
)
zhc
)
(repeat (sslength lsta)
(setq ent (ssname lsta ii))
(setq ent1 (cdr(assoc 1(entget ent))))
(setq lst (str->chrs ent1))
(entmod (subst (cons 1 lst) (assoc 1(entget ent)) (entget ent) ))
(setq ii (1+ ii))
)
)
页:
[1]