Weird Error in Save As Rule (iLogic)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am building out some iLogic rules to make a current workflow more efficient. One of the small things I wanted to add has already taken far too much time and is throwing errors I cant find the source of.
Basically I just want to have "Revision Form" that would check the current revision, go up by a letter, then change the iProperty and do a save as "FileName Rev.X". I'm a bit unfamiliar with VB so after not being able to figure out this one I just made the Revision number part of the form. For some reason it only works with certain letters. Rev A doesn't work. Rev B does. C doesn't work, but D and E both do.
I've attached screenshots of all this and I will post the code as text. Any help figuring out why certain letters do not work would be much appreciated.
Full Doc Title didn't populate. Should Show as "Form Tests Rev. A"
Proper Document name Populated.
Dim revisionFileName As String 'define the active document oDoc = ThisDoc.Document 'create a file dialog box Dim oFileDlg As Inventor.FileDialog = Nothing InventorVb.Application.CreateFileDialog(oFileDlg) 'check file type and set dialog filter If oDoc.DocumentType = kPartDocumentObject Then oFileDlg.Filter = "Autodesk Inventor Part Files (*.ipt)|*.ipt" Else If oDoc.DocumentType = kAssemblyDocumentObject Then oFileDlg.Filter = "Autodesk Inventor Assembly Files (*.iam)|*.iam" Else If oDoc.DocumentType = kDrawingDocumentObject Then oFileDlg.Filter = "Autodesk Inventor Drawing Files (*.idw)|*.idw" End If 'set the directory to open the dialog at oFileDlg.InitialDirectory = ThisDoc.WorkspacePath() 'set the file name string to use in the input box revisionFileName = ThisDoc.FileName(False) + " Rev." + newRevChange oFileDlg.FileName = revisionFileName 'work with an error created by the user backing out of the save oFileDlg.CancelError = True On Error Resume Next 'specify the file dialog as a save dialog (rather than a open dialog) oFileDlg.ShowSave() 'catch an empty string in the imput If Err.Number <> 0 Then MessageBox.Show("No File Saved.", "iLogic: Dialog Canceled") ElseIf oFileDlg.FileName <> "" Then MyFile = oFileDlg.FileName iProperties.Value("Project", "Revision Number") = newRevChange 'save the file oDoc.SaveAs(MyFile, False) 'True = Save As Copy & False = Save As End If