- 积分
- 228
- 明经币
- 个
- 注册时间
- 2010-12-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2010-12-14 11:23:56
|
显示全部楼层
If InStr(adText.textString, "1.0") Then adText.textString = "1.6"语句的问题弄清楚了,原来我要改的文字是Mtext,不是text。。不好意思。不过If adText.textString = "350" Then adText.textString = "300"怎么还是没作用呢,各位高手帮看一下呀~
Public Sub Text2()
Dim TextSelect As AcadSelectionSet
Dim filterType(0) As Integer
Dim filterData(0)
Dim adText As AcadMText
On Error Resume Next
filterType(0) = 0: filterData(0) = "Mtext"
If Not IsNull(ThisDrawing.SelectionSets.Item("TextSelect")) Then
Set TextSelect = ThisDrawing.SelectionSets.Item("TextSelect")
TextSelect.Delete
End If
Set TextSelect = ThisDrawing.SelectionSets.Add("TextSelect")
TextSelect.Select acSelectionSetAll, , , filterType, filterData
For Each adText In TextSelect
If InStr(adText.textString, "1.0") Then adText.textString = "1.6"
If adText.textString = "350" Then adText.textString = "300"
Next
End Sub
|
|