;一个文字击碎程序(字符断开)
(DEFUN C:hzbrea ()
 (princ "\nselect object:")
 (setq s (ssget))
 (setq n (sslength s))
 (setq name (ssname s 0))
 (setq a (entget name))
 (setq t (assoc '0 a))
 (setq p1 (assoc '10 a))
 (setq p2 (assoc '11 a))
 (setq xx (cdr p1) x1 (car xx) y1 (cdr xx) y1 (car y1))
 (setq t (cdr t))
 (if (= t "TEXT") (PROGN
     (setq h (assoc '1 a))
     (setq hi (assoc '40 a))
     (setq tx (cdr h) hi (cdr hi))(setq hi (+ hi 1))
     (princ "汉字高<") (princ hi)(princ ">:")
     (setq hii (getint))
     (if (/= hii nil)(setq hi hii))
     (setq sss (getint"角度<0>:"))
     (if (= sss nil)(setq sss 0))
     (setq aa (entdel name))
     (setq p0 (list x1 y1))
     (setq h1 (- hi 1) dat1 (* hi 0.75) dat2 (* h1 0.75))
     (setq px1 (car p0) py1 (cadr p0))
     (setq n 0)(setq m 1)
     (while (/= n nil)
       (setq tx1 (substr tx m 1))
       (setq ask (ascii tx1))
       (setq nn (or (< ask 32) (> ask 126)))
       (if (/= nn nil)(progn
           (setq tx2 (substr tx m 2))
           (setq m (+ m 2))
           (if (= sss 0) (setq px1 (+ dat1 px1))(setq py1 (+ dat1 py1)))
           (command "text" "s" "hz" p0 hi sss tx2)
           (setq p0 (list px1 py1))
           ))
       (if (= nn nil)(progn
           (if (= tx1 "%")(progn
               (setq tx2 (substr tx m 3))
               (setq m (+ m 3))
               (if (= sss 0) (setq px1 (+ dat2 px1))(setq py1 (+ dat2 py1)))
               (command "text" "s" "A" p0 h1 sss tx2)
               (setq p0 (list px1 py1))
               ))
           (if (/= tx1 "%")(progn
               (setq tx2 (substr tx m 1))
               (setq m (+ m 1))
               (if (/= tx1 "m") (progn
                   (if (= sss 0) (progn
                       (setq px1 (+ dat2 px1))
                       ))
                   (if (/= sss 0) (progn
                       (setq py1 (+ dat2 py1))
                       ))
               ))
               (if (= tx1 "m") (progn
                   (if (= sss 0) (progn
                       (setq px1 (+ (* 1.5 dat2) px1))
                       ))
                   (if (/= sss 0) (progn
                       (setq py1 (+ (* dat2 1.5) py1))
                       ))
               ))
               (if (= tx1 "?") (setq tx2 " "))
               (command "text" "s" "A" p0 h1 sss tx2)
               (setq p0 (list px1 py1))
               ))
           ))
     (if (= tx1 "") (setq n nil))
     )
(command "redraw")
))
)
