- 积分
- 1898
- 明经币
- 个
- 注册时间
- 2003-6-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-10-13 09:52:00
|
显示全部楼层
'将单行文本改为多行文本
Private Sub CommandButton2_Click()
Dim ft(0) As Integer
Dim fl(0) As Variant
Dim mt As AcadMText
'定义过滤条件
ft(0) = 0
fl(0) = "text"
Set s = ThisDrawing.SelectionSets.Add("bba11")
Me.Hide
s.SelectOnScreen ft, fl
Dim e As AcadText
For Each e In s
a = e.TextString
Set mt = ThisDrawing.ModelSpace.AddMText(e.InsertionPoint, e.Height, a)
e.Delete
Next
ThisDrawing.Regen acActiveViewport
End Sub
’将这段程序加载进VB管理器里即可。
‘将多个单行文本合为一个多行文本
Private Sub CommandButton1_Click()
Dim ft(0) As Integer
Dim fl(0) As Variant
Dim mt As AcadMText
'定义过滤条件
ft(0) = 0
fl(0) = "text"
Set s = ThisDrawing.SelectionSets.Add("bb1aa1")
Me.Hide
s.SelectOnScreen ft, fl
Dim e As AcadText
Dim p(2) As Double
p(0) = 0
p(1) = 0
p(2) = 0
For Each e In s
a = a & e.TextString
e.Delete
Next
Set mt = ThisDrawing.ModelSpace.AddMText(p, 5, a)
ThisDrawing.Regen acActiveViewport
End Sub |
|