Explode MTEXT

Explode MTEXT

Anonymous
Not applicable
265 Views
2 Replies
Message 1 of 3

Explode MTEXT

Anonymous
Not applicable
What is the best method to explode Mtext? I understand that I can not
explode the object directly.
I am currently perusing to find the Mtext string, and simply add new text in
the same location with same info, minus the fields, but I am having
difficulties with the attachmentpoint. Can anyone shed some light on the
attachmentpoints for me?
Thanks, Dan
0 Likes
266 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I figured out a way...Thanks.
"Dan" wrote in message
news:4862122@discussion.autodesk.com...
What is the best method to explode Mtext? I understand that I can not
explode the object directly.
I am currently perusing to find the Mtext string, and simply add new text in
the same location with same info, minus the fields, but I am having
difficulties with the attachmentpoint. Can anyone shed some light on the
attachmentpoints for me?
Thanks, Dan
0 Likes
Message 3 of 3

Anonymous
Not applicable
I wrote this fucntion to return exploded Mtext as text entities. It Unfortunately, uses the sendcommand to explode a copy of the MText. The calling code is responsible for deleting the newly created text entities.

Public Function GetMTextAsText(aMT As AcadMText) As Variant
Dim iTC As Long, vObj As Variant, aMT2 As AcadMText, lCT As Long
Dim lT As Long, aBlk As AcadBlock, vObjs(0 To 0) As Object

Set aBlk = ThisDrawing.ObjectIdToObject(aMT.OwnerID)
iTC = ThisDrawing.ModelSpace.Count
If (Not UCase(aBlk.Name) Like "**MODEL_SPACE*") Then
Set vObjs(0) = aMT
ThisDrawing.CopyObjects vObjs, ThisDrawing.ModelSpace
Else
aMT.Copy
End If
ThisDrawing.SendCommand "explode L " + vbCr
lCT = ThisDrawing.ModelSpace.Count - iTC - 1
ReDim vObj(0 To lCT)
lT = 0
For lCT = iTC To ThisDrawing.ModelSpace.Count - 1
Set vObj(lT) = ThisDrawing.ModelSpace(lCT)
lT = lT + 1
Next
GetMTextAsText = vObj
End Function
0 Likes