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.
Here’s how:
- 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) )
its been a few years since ive used customized commands. is the file extension for the code above “.lsp”? also, you load it with “@appload”, correct? thank you!
You are right – the code that is posted here is a LISP file (.lsp) and you can use appload or you can also just drag & drop the lisp file into the drawing area. See the links about how to copy the code if you are having troubles https://autocadtips.wordpress.com/about/
~Greg
cheers for this script
This works great! I was not having the repetitive edit, select all, copy, escape, edit, paste, escape routine.