tomasz.wilk741723
2017-01-13, 04:16 PM
Hello,
I have a drawing with many objects of type TEXT. I have to change the texts to polylines. In the Express Tools there is a tool for that, that is called TXTEXP. If I try to use it out of the box, the text is very distorted, as there are many texts on a large area. If I run TXTEXP for a single text line it is perfect.
Now to the point. I have tried to use Lisp to select objects one by one and then run TXTEXP. So far I have learned why this doesn't work:
(command "TXTEXP" selset "")
TXTEXP is not a builtin command but the lisp code itself. So far I have this code:
(defun c:TXTEXP_Repeat ( / e i s ent l x selset)
(if (setq s (ssget))
(progn
(setq i 0)
(setq l (sslength s))
(repeat l
(setq e (ssname s i)
x (cdr (assoc 0 (entget e)))
ent (entget e)
i (1+ i)
)
(if (= x "TEXT")
(progn
(setq selset (ssadd e))
(command "_SELECT" selset "")
(c:TXTEXP)
(print (strcat "\nItem " (itoa i) " out of " (itoa l)))
)
(progn ;else
(print (print (strcat "\nItem " (itoa i) " not a TEXT. ")))
)
)
)
)
)
(princ)
)
It doesn't work - the selection made from the selset selection set does not go to TXTEXP, which still asks to select text for exploding. I have run out of ideas. Anyone can help?
Cheers
Tomasz
I have a drawing with many objects of type TEXT. I have to change the texts to polylines. In the Express Tools there is a tool for that, that is called TXTEXP. If I try to use it out of the box, the text is very distorted, as there are many texts on a large area. If I run TXTEXP for a single text line it is perfect.
Now to the point. I have tried to use Lisp to select objects one by one and then run TXTEXP. So far I have learned why this doesn't work:
(command "TXTEXP" selset "")
TXTEXP is not a builtin command but the lisp code itself. So far I have this code:
(defun c:TXTEXP_Repeat ( / e i s ent l x selset)
(if (setq s (ssget))
(progn
(setq i 0)
(setq l (sslength s))
(repeat l
(setq e (ssname s i)
x (cdr (assoc 0 (entget e)))
ent (entget e)
i (1+ i)
)
(if (= x "TEXT")
(progn
(setq selset (ssadd e))
(command "_SELECT" selset "")
(c:TXTEXP)
(print (strcat "\nItem " (itoa i) " out of " (itoa l)))
)
(progn ;else
(print (print (strcat "\nItem " (itoa i) " not a TEXT. ")))
)
)
)
)
)
(princ)
)
It doesn't work - the selection made from the selset selection set does not go to TXTEXP, which still asks to select text for exploding. I have run out of ideas. Anyone can help?
Cheers
Tomasz