Results 1 to 8 of 8

Thread: Multi line Mtext to Single line Mtext

  1. #1
    Member
    Join Date
    2007-11
    Posts
    2
    Login to Give a bone
    0

    Question Multi line Mtext to Single line Mtext

    Is there a lisp or shortcut to convert a multiple line mtext to a single line mtext?

    Your help is greatly appreciated.
    Thank you.

    Craig II <><

  2. #2
    AUGI Addict
    Join Date
    2005-07
    Posts
    2,356
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Quote Originally Posted by csiress.154683 View Post
    Is there a lisp or shortcut to convert a multiple line mtext to a single line mtext?

    Your help is greatly appreciated.
    Thank you.

    Craig II <><
    Why do you want single line Mtext?

    You can just explode the Mtext (to convert to Dtext) and either leave it or then use the txt2mtxt command. I guess you can create a macro or lisp to that if that's what you mean.

  3. #3
    Member
    Join Date
    2007-11
    Posts
    2
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Thank you for your reply.
    I don't know why I didn't think of it earlier, explode and convert back to mtext.
    Easy as that.

    Take Care.

  4. #4
    Member
    Join Date
    2013-01
    Posts
    7
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Yes the above answer is ok if you do not have any fields in text, but how to do that with mtext containing fields so the fields stay fields?!

  5. #5
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Extract the string (assoc 1 (entget <ename>)) and put it back, then explode.

  6. #6
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Code:
    this.Mode = Modes.ProfessorChaos;
    Code:
    (defun c:FOO (/ ss oldEnt eData asso eName)
      (if (setq ss (ssget ":S:E:L" '((0 . "MTEXT"))))
        (progn
          (setq oldEnt (entlast))
          (entmod
            (subst
              (cons
                1
                (cdr
                  (setq asso (assoc 1 (setq eData (entget (ssname ss 0)))))
                )
              )
              asso
              eData
            )
          )
          (command "._explode" ss)
          (setq eName oldEnt)
          (while (and (setq eName (entnext eName))
                      (= "TEXT" (cdr (assoc 0 (entget eName))))
                 )
            (command "txt2mtxt" eName "")
          )
          (setq eName oldEnt)
          (while (setq eName (entnext eName))
            (entmod
              (subst
                (cons
                  41
                  (* 0.0
                     (cdr
                       (setq asso (assoc 41 (setq eData (entget eName)))
                       )
                     )
                  )
                )
                asso
                eData
              )
            )
          )
        )
      )
      (princ)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  7. #7
    All AUGI, all the time
    Join Date
    2010-10
    Posts
    535
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Quote Originally Posted by BlackBox View Post
    Code:
    (defun c:FOO (/ ss oldEnt eData asso eName)
      (if (setq ss (ssget ":S:E:L" '((0 . "MTEXT"))))
        (progn.......
    I dont get it BlackBox and what of this?

    "....but how to do that with mtext containing fields so the fields stay fields?!"

    unlikely i'm sure but MTEXT string more that 250 [?] characters wont be included with DXF 1.

  8. #8
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Multi line Mtext to Single line Mtext

    Quote Originally Posted by pbejse View Post
    I dont get it BlackBox and what of this?
    ... Just demonstrating, which regretfully doesn't do this:

    Quote Originally Posted by pbejse View Post
    "....but how to do that with mtext containing fields so the fields stay fields?!"
    ... And I didn't know that:

    Quote Originally Posted by pbejse View Post
    unlikely i'm sure but MTEXT string more that 250 [?] characters wont be included with DXF 1.
    ... So, cheers... You know, for that.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. 2011: Express Tools Auto Number - Skips Number in Multi-line Mtext
    By stusic in forum AutoCAD General
    Replies: 3
    Last Post: 2013-01-29, 02:38 PM
  2. Convert a multi-line to a single line
    By Richard McDonald in forum AutoCAD General
    Replies: 7
    Last Post: 2007-05-09, 04:32 PM
  3. Replies: 8
    Last Post: 2007-03-12, 02:18 AM
  4. Strike-through in MText and single line Text
    By lem_102074329 in forum AutoCAD General
    Replies: 1
    Last Post: 2006-10-18, 05:54 AM
  5. Convert single line text to multi line text?
    By civilguy in forum AutoCAD General
    Replies: 3
    Last Post: 2006-10-11, 11:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •