Results 1 to 5 of 5

Thread: Convert Mtext to Text

  1. #1
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Convert Mtext to Text

    After researching the web and all my VBA manuals, it seems that Autodesk has never exposed a method to explode Mtext. (It can be done on the command line)

    Anyone know more about this oversight?

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Convert Mtext to Text

    You are correct. There is no hope in the ActiveX API.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: Convert Mtext to Text

    I can find multitext using VBA/oDBX and move it to a unique layer. But because I cannot explode the mtext, I can't solve my problem, which is to convert mtext into plain text. I could get the text string, but then I would have to parse out the formatting. Ughh!

    Below is the heart of the code:

    Code:
     
    Multicount = 0
        For i = 0 To oDBX.PaperSpace.Count - 1
            Set Entity = oDBX.PaperSpace.Item(i)
            If Entity.ObjectName = "AcDbMText" Then
                Ipt = Entity.InsertionPoint
                If Ipt(0) > 1027 And Ipt(1) < 211 Then
                    CreateLayer ("_jarosz")
                    Entity.Layer = "_jarosz"
                    Multicount = Multicount + 1
                 End If
            End If
        Next i
    I CAN write a simple acad script to do the explode mtext:

    Code:
     
    layer
    set
    _jarosz
    freeze
    *
    explode
    all
    layer
    thaw
    *
    Will SendCommand work in oDBX? That would be the answer. Or, could I run the script as a subroutine somehow?

    Any ideas?

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Convert Mtext to Text

    You cannot use SendCommand, or run a script, in an ODBX document. There is no command line in that circumstance.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2015-10
    Location
    New York NY
    Posts
    1,497
    Login to Give a bone
    0

    Default Re: Convert Mtext to Text

    [sound of sighing].....

    I guess I can (save as) the processed file then rerun them with the script. We have a batch processor that can do that. I was hoping to save a step.

    Incidentally, why am I doing this?

    We have a project with 900 sheets that ignored every title block standard we have. Users have used every combination of loose text, loose attributes, blocks with attributes and multitext, in a totally inconsistent manner. I propose to retrieve each text-like object, turn it into real text and then insert a properly created block with well defined attributes.

    The mtext is the problem. I need a one to one correspondance between old text and new block attribute. When the date, scale and drawn_by are combined into a single mtext, I need to break them apart to assign the text string to the correct attribute.

    Most of the program to do this is already written and works fine in those cases where there is no mtext.

    I guess I will have to make two passes over the data.

Similar Threads

  1. Bring "Convert Text to MText" to AutoCAD LT
    By Wish List System in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2013-11-16, 12:10 PM
  2. Globally convert text to mtext
    By Stephen.Walz in forum AutoLISP
    Replies: 11
    Last Post: 2006-12-08, 08:45 PM
  3. convert all text to mtext
    By c_rado in forum AutoCAD General
    Replies: 6
    Last Post: 2006-12-03, 11:15 PM
  4. AutoCAD LT 2006 - Convert Text to MText?
    By flansburg in forum AutoCAD LT - General
    Replies: 3
    Last Post: 2006-03-07, 07:59 AM
  5. Vl commands to convert text to Mtext
    By ccowgill in forum AutoLISP
    Replies: 10
    Last Post: 2006-03-03, 06:54 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
  •