Sub TextEdit()
Dim T As AcadText
Dim E As AcadEntity
Dim P As Variant
On Error Resume Next
ThisDrawing.Utility.GetEntity E, P, "请选择一个单行文字:"
If Err.Number <> 13 And Err.Number <> 0 Then Exit Sub
Do Until E.ObjectName = "AcDbText"
Err.Clear
ThisDrawing.Utility.GetEntity E, P, "请选择一个单行文字:"
If Err.Number <> 13 And Err.Number <> 0 Then Exit Sub
Loop
Set T = E
Dim S As Variant
'MsgBox T.textString
Dim F As String
F = "一级钢 %%130;二级钢 %%131;三级钢 %%132;" & vbCrLf _
& "管径 %%129;度数 %%d;正负 %%p;" & vbCrLf _
& "上标 %%140字符%%141;下标 %%142字符%%143:" & vbCrLf _
& "下划线 %%U字符%%U"
S = InputBox(F, "田草工具箱", T.textString)
If S <> "" Then
T.textString = S
T.Update
End If
End Sub
Dim T As AcadText
Dim E As AcadEntity
Dim P As Variant
On Error Resume Next
ThisDrawing.Utility.GetEntity E, P, "请选择一个单行文字:"
If Err.Number <> 13 And Err.Number <> 0 Then Exit Sub
Do Until E.ObjectName = "AcDbText"
Err.Clear
ThisDrawing.Utility.GetEntity E, P, "请选择一个单行文字:"
If Err.Number <> 13 And Err.Number <> 0 Then Exit Sub
Loop
Set T = E
Dim S As Variant
'MsgBox T.textString
Dim F As String
F = "一级钢 %%130;二级钢 %%131;三级钢 %%132;" & vbCrLf _
& "管径 %%129;度数 %%d;正负 %%p;" & vbCrLf _
& "上标 %%140字符%%141;下标 %%142字符%%143:" & vbCrLf _
& "下划线 %%U字符%%U"
S = InputBox(F, "田草工具箱", T.textString)
If S <> "" Then
T.textString = S
T.Update
End If
End Sub
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |