本帖最后由 作者 于 2004-4-20 11:45:07 编辑
取消多行文字的中格式设置,只有再把它炸开再合并 - Sub MToS()
- Dim pnt, ent As AcadMText
- Dim m As Integer, n As Integer
- ThisDrawing.Utility.GetEntity ent, pnt, vbCr & "请选择多行文字:"
- ent.TextString = Replace(ent.TextString, "\P", " ")
- ent.Width = 0
- m = ThisDrawing.ModelSpace.Count
- ThisDrawing.SendCommand "Explode" & vbCr & "(handent " & Chr(34) _
- & ent.Handle & Chr(34) & ")" & vbCr & vbCr
- n = ThisDrawing.ModelSpace.Count
- If m = n Then Exit Sub
- For i = m + 1 To n
- ThisDrawing.ModelSpace(m - 1).TextString = _
- ThisDrawing.ModelSpace(m - 1).TextString + _
- ThisDrawing.ModelSpace(m).TextString
- ThisDrawing.ModelSpace(m).Delete
- Next i
- End Sub
|