Jump to content

Single Line Stacked MText Combined Togehter


Recommended Posts

Posted

Is their way to take a group of single line MText that are stacked and make them one MText, but keep them stacked and in order from top to bottom?

Posted

Sort the selected items by their Y value (insertion point) and append each text value to the first item.

 

Did you try Txt2Mtxt?

Posted

I have tried txt2mtxt, but does that still work if the text is already mtext?

Posted

This was fun...

 

(defun c:Combine (/ ss)
 ;; Combine MText and Text (sorted by Y value) into top most text object
 ;; Alan J. Thompson, 09.24.10

 (vl-load-com)

 (if (setq ss ((lambda (ss i / e l lst)
                 (if ss
                   (while (setq e (ssname ss (setq i (1+ i))))
                     (setq lst (cons
                                 (list e
                                       (caddr (assoc 10 (setq l (entget e))))
                                       (apply 'strcat
                                              (append (mapcar '(lambda (x)
                                                                 (if (vl-position (car x) '(1 3))
                                                                   (cdr x)
                                                                   ""
                                                                 )
                                                               )
                                                              l
                                                      )
                                                      '("\\P")
                                              )
                                       )
                                 )
                                 lst
                               )
                     )
                   )
                 )
               )
                (ssget "_:L" '((0 . "MTEXT,TEXT")))
                -1
              )
     )
   (vla-put-textstring
     (vlax-ename->vla-object (caar (setq ss (vl-sort ss '(lambda (a b) (> (cadr a) (cadr b)))))))
     (apply 'strcat
            (append (list (caddar ss))
                    (mapcar '(lambda (x) (entdel (car x)) (caddr x)) (cdr ss))
            )
     )
   )
 )
 (princ)
)

Posted

Don't thank me, thank Lee

 

You beat me to the reply Lee

Posted

Thank You, Lee. I enjoy your insight on this forum. I am a long time Microstation user and just now switching over to AutoCAD 2010 and yours and everyone else's post have really helped in my transition.

Posted
Thank You, Lee. I enjoy your insight on this forum. I am a long time Microstation user and just now switching over to AutoCAD 2010 and yours and everyone else's post have really helped in my transition.

 

You're welcome, I'm glad you could glean something from mine (and others') posts :)

Posted
All for not. :roll:

 

Don't be like that Alan - the thread seemed nigh concluded before you posted.

Posted
Don't be like that Alan - the thread seemed nigh concluded before you posted.
I'm not upset, I was just laughing at the situation. I scratched the code out, but was a little behind at getting it posted. I didn't want it to go to waste.
Posted
I'm not upset, I was just laughing at the situation. I scratched the code out, but was a little behind at getting it posted. I didn't want it to go to waste.

 

Oh OK

 

stupid10charlimitwishthatcouldbetakenoff

Posted
Oh OK

 

stupid10charlimitwishthatcouldbetakenoff

agr[as;lkfjas;lfkjasdf]eed.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...