Hi @D.Wheeler3GADA. This is just another similar example of some fairly simple iLogic code for adding a 2 digit, incrementing Integer suffix to the end of a proposed file name for the SaveAs method. I put that code into its own custom Sub routine 'SaveAsWithSuffix', because it's fairly popular, and will work with whichever document you supply it.
Sub Main
'specify the document to SaveAs
oDoc = ThisDoc.Document
'specify proposed new full file name
oFullFileName = "C:\Temp\My Assembly.iam"
'use the custom Sub routine to ensure it succeeds
SaveAsWithSuffix(oDoc, oFullFileName)
End Sub
Sub SaveAsWithSuffix(oDoc As Document, oNewFullName As String)
If Not System.IO.File.Exists(oNewFullName) Then
Try
oDoc.SaveAs(oNewFullName, False)
Catch oEx As Exception
Logger.Error("SaveAs Failed!" & vbCrLf & oEx.Message & vbCrLf & oEx.StackTrace)
End Try
Else
oPathAndName = System.IO.Path.ChangeExtension(oNewFullName, vbNullString)
oExt = System.IO.Path.GetExtension(oNewFullName)
Dim oAltNewFullName As String = ""
For i As Integer = 1 To 99
oSuffix = i.ToString("D2")
oAltNewFullName = oPathAndName & oSuffix & oExt
If System.IO.File.Exists(oAltNewFullName) Then Continue For
Try
oDoc.SaveAs(oAltNewFullName, False)
Catch oEx As Exception
Logger.Error("SaveAs Failed!" & vbCrLf & oEx.Message & vbCrLf & oEx.StackTrace)
End Try
Exit For
Next
End If
End Sub
Wesley Crihfield

(Not an Autodesk Employee)