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?
|
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?
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.
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:
I CAN write a simple acad script to do the explode mtext: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
Will SendCommand work in oDBX? That would be the answer. Or, could I run the script as a subroutine somehow?Code:layer set _jarosz freeze * explode all layer thaw *
Any ideas?
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.
[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.