

'This is an older function taken from ad_FindReplaceĭim i As Integer, oldStrLen As Integer, holdStr As String, StrLoc As Integer Public Function replaceStr(ByVal searchStr As String, ByVal oldStr As String, ByVal newStr As String, _

Set adNewText = (holdStr, adEntity.insertionPoint, adEntity.height) adEntity, basePnt, "Pick Text or MText Entity> " What a mess I hope someone can help me or else I have alot of work just converting text to Mtext ahead. The idea is to convert all the text on a drawing to Mtext so I can run a second macro that exports our BOMs to an excel sheet and that that macro only exports Mtext which is why I need to convert the text. Most or all of our drawings are in layout. If I click text in Layout it converts it and places it in model space. Also I realized that this only works in model space and not in layout. Sorry that was only part of the code heres the rest I'm still trying to figure this out. Set adNewMText = (adEntity.insertionPoint, Len(holdStr), holdStr)ĪdNewMText.AttachmentPoint = acAttachmentPointTopLeft Set adNewText = (holdStr, adEntity.insertionPoint, adEntity.Height)ĮlseIf adEntity.ObjectName = "AcDbText" Then If InStr(holdStr, "\P") Then holdStr = replaceStr(holdStr, "\P", " ", False) 'This call is used to remove MText formatting from the string

If adEntity.ObjectName = "AcDbMText" Then adEntity, basePnt, "Pick MText Entity> " ' property, but it will be left to you to implement the conversion for ' while Text uses the Alignment property. 'One of the things you will probably need to address is the Justification The only problem with it is after it converts the text it places the text in weird locations on the drawing sometimes just a little lower sometimes it the middle of the drawing i need it to place the Mtext in the exact position of the old text. I have this code from some website that will convert text to mtext in autocad.
