Here it is
<CommandMethod("t13")>
PublicSubT13()
'Change the drawing Number
MsgBox("Please place all the sheet under the this path C:\x and create an empty folder under the C:\1 that drawings will be placed in")
Dim direc AsString = "C:\x"Dim filecount AsInteger = System.IO.Directory.GetFiles(direc, "*.dwg").Length
Dim arrfile() AsString = System.IO.Directory.GetFiles(direc, "*.dwg")
Dim val AsInteger = InputBox("Please Enter the value you want to add to the text")
Dim adedo AsEditor = Application.DocumentManager.MdiActiveDocument.Editor
Try
Dim i AsInteger= 0
For i = 0 To filecount - 1
Dim currentFile AsString= arrfile(i)
Dim doc AsDocument = Application.DocumentManager.Open(currentFile, False)
Dim db AsDatabase= doc.Database
Dim newfil AsString= Replace(currentFile, Mid(Right(currentFile, 7), 1, 3), Mid(Right(currentFile, 7), 1, 3) + val)
newfil = Replace(newfil,
"C:\x\", "C:\1\")
Dim doclock AsDocumentLock= doc.LockDocument
Usingdoclock
Dim trans AsTransaction= db.TransactionManager.StartTransaction()
Using(trans)
Dim ly1 AsLayoutManager = LayoutManager.Current
LayoutManager.Current.CurrentLayout = "Layout1"
trans.Commit()
EndUsingEndUsing
doc.Database.SaveAs(newfil,
True, DwgVersion.Current, doc.Database.SecurityParameters)
doc.CloseAndDiscard()
Next
Catch ex As Autodesk.AutoCAD.Runtime.Exception
MsgBox(ex.Message & vbLf & ex.StackTrace)
Finally
MsgBox("Done")
EndTry
EndSub