未测试,仅考虑左对齐text图元
- (defun c:tt (/ a b c en ent h m n pt str)
- (while (setq en (car (entsel "\n拾取文字:")))
- (setq str (cdr (assoc 1 (setq ent (entget en)))))
- (if (wcmatch str "*`-*`~*")
- (progn (setq m (vl-string-search "-" str)
- n (vl-string-search "~" str)
- a (substr str 1 m)
- b (substr str (+ 2 m) (- n m 1))
- c (substr str (+ 2 n))
- b (atoi b)
- c (atoi c)
- h (cdr (assoc 40 ent)))
- (setq pt (getpoint "\n拾取点:"))
- (repeat (- c b -1)
- (setq ent (subst (cons 10 pt) (assoc 10 ent) ent)
- ent (subst (cons 1 (strcat a "-" (itoa b))) (assoc 1 ent) ent)
- pt (polar pt (* -0.5 pi) h)
- b (1+ b))
- (entmake ent)))))
- (princ))
|