I recently found this little routine and I am sure going to be using it. Heck, I could have used it for a while now.
It is simple. It joins MTEXT objects into a single MTEXT object.
- JMTX <enter> to start
- Select the MTEXT objects to be joined. (Note: the order in which you select the MTEXT objects will determine the order the final MTEXT object.)
- <enter> to finish
;; by Joe Burke at Autodesk Forums ;; Join mtext demo. ;; The order of selection determines the result. ;; The first mtext object selected is modified and ;; others are deleted. (defun c:jmtx ( / e obj lst str) (vl-load-com) (while (and (setq e (car (entsel "\nSelect mtext: "))) (setq obj (vlax-ename->vla-object e)) (equal "AcDbMText" (vlax-get obj 'ObjectName)) ) (setq lst (cons obj lst)) ) (setq obj (last lst)) (setq str (vlax-get obj 'TextString)) (foreach x (cdr (reverse lst)) (setq str (strcat str "\\P" (vlax-get x 'TextString))) (vla-delete x) ) (vlax-put obj 'TextString str) (princ) )