I'm trying to append a Field at the end of mtext string.
When in the mtext string there is a sub string with the same value of the Field, the second time that I append the
Field, the sub string became a Field!!!
try this:
create mtext like this: "1 xxx yyy zzz"
then set a lisp variable to "xxx" :
(setq test "xxx")
run this code 2 time:
(setq te(car(entsel)))
(setq tx(vla-FieldCode (vlax-ename->vla-object te)))
(vla-put-textstring (vlax-ename->vla-object te) (strcat tx " " "%<\\AcVar.17.0 Lisp.test>%"))
the second time, the first "xxx", becames a Field :-O
(tested with AutoCAD 2013)