Dim files, path, filename

    path = ThisDrawing.Utility.GetString(True, "输入dwg文件所在路径:")
'dwg文件路径 If path = "" Then Return files = Dir(path & "*.dwg")


Dim text As AcadText Do While files <> "" '打开dwg文件
ThisDrawing.Application.Documents.Open (path & files) For Each e In ThisDrawing.ModelSpace '设置颜色为白色
e.color = 'Debug.Print e.ObjectName If e.ObjectName = "AcDbText" Then
Set text = e
If Left(text.TextString, ) = "宗" Then
text.Delete
End If
End If
Next ThisDrawing.Save
ThisDrawing.Close
files = Dir()
Loop

删除dwg文件中第一个字为“宗”的所有文字

05-07 15:34