Hi,
The FIELD object is stored in a dictionary ("TEXT") which is stored in a dictionary ("ACAD_FIELD") which is stored in the extension dictionary of the text, mtext or attribute. So you'll have to entmake these entries (dictionaries) in the mtext extension dictionary, more a "FIELD" object...
You'd rather use (vla-put-TextString ...) which works with field codes.
I wrote a routine to get the field code of TEXT, MTEXT or ATTRIBUTES because vla-FieldCode doesn't work with attributes. You can get some inspiration if you really need to use entmake...
;; gc:FieldCode (gile)
;; Retourne la chaîne de caractère d'un attribut, texte ou mtexte
;; avec le(s) code(s) de champ(s)
;;
;; Argument : nom d'entité de l'objet (ENAME)
(defun gc:FieldCode (ent / foo elst xdict dict field str)
;;--------------------------------------------------------;;
(defun foo (field str / pos fldID objID)
(setq pos 0)
(if (setq pos (vl-string-search "\\_FldIdx " str pos))
(while (setq pos (vl-string-search "\\_FldIdx " str pos))
(setq fldId (entget (cdr (assoc 360 field)))
field (vl-remove (assoc 360 field) field)
str (strcat
(substr str 1 pos)
(if (setq objID (cdr (assoc 331 fldId)))
(vl-string-subst
(strcat "ObjId " (itoa (gc:EnameToObjectId objID)))
"ObjIdx"
(cdr (assoc 2 fldId))
)
(foo fldId (cdr (assoc 2 fldId)))
)
(substr str (1+ (vl-string-search ">%" str pos)))
)
)
)
str
)
)
;;--------------------------------------------------------;;
(setq elst (entget ent))
(if (and
(member (cdr (assoc 0 elst)) '("ATTRIB" "MTEXT" "TEXT"))
(setq xdict (cdr (assoc 360 elst)))
(setq dict (dictsearch xdict "ACAD_FIELD"))
(setq field (dictsearch (cdr (assoc -1 dict)) "TEXT"))
)
(setq str (foo field (cdr (assoc 2 field))))
)
)