Here's a beginning of a routine, for your consideration:
(defun C:SM2 ; = Split Mtext into 2 pieces [around double space delimiter]
(/ ss n mt mto1 txtinit mto2)
(if (setq ss (ssget ":L" '((0 . "MTEXT"))))
(repeat (setq n (sslength ss))
(setq
mt (ssname ss (setq n (1- n)))
mto1 (vlax-ename->vla-object mt)
txtinit (vla-get-TextString mto1)
dsp (vl-string-search " " txtinit); double space position
); setq
(command "_.copy" mt "" '(0 0) "")
(setq mto2 (vlax-ename->vla-object (entlast)))
(vla-put-TextString mto1 (substr txtinit 1 dsp)); string before double space
(vla-put-TextString mto2 (substr txtinit (+ dsp 3))); string after double space
(vla-put-AttachmentPoint mto2 3); top-right justification
); repeat
); if
(princ)
); defun
BUT note certain assumptions, limitations, etc.:
It assumes the original is top-left justified in typical default fashion for Mtext, so if that might not always be the case, something would have to be done to accommodate different possibilities.
Given that justification, it copies it in place, then assigns top-right justification to the copy that gets the second-half text content. That uses the right end of the "defined width" of the Mtext "box," which may be wider [maybe a lot wider] than the actual content. If so, the second-half piece will move more significantly. If that's a meaningful issue, there are routines around that you can apply to pull the "defined width" of Mtext in to just the size of the actual content.
Speaking of defined width of the box, it assumes the initial content doesn't exceed that, i.e. there is no word wrapping based on that. It "works" if there is, but the positioning can result in overlap of the two resulting pieces.
It assumes that there is, in fact, a double space somwhere in the text content, but could be made to check for that first.
And it doesn't have all the usual bells and whistles yet....
I'm playing with some possibilities to overcome some of those things, and may be back with improvements, but see what you think so far.
Kent Cooper, AIA