Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am doing with save copy as with a rule.
The "Save As" folder resorts to "Projects" despite I assigned different folder path. I saw many help in the forum: they all give the same result. Could someone help me please.
Sub Main() oExit = MessageBox.Show("EXIT?", "Title", MessageBoxButtons.YesNo) If oExit = vbYes Then Exit Sub saveFolderStp = "C:\Roy XX\1551\STP" saveFolderIges = "C:\Roy XX\1551\IGES" oModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) Dim FFN_wExt As String FFN_wExt = ThisDrawing.ModelDocument.FullFileName 'specify word splitting characters "space" and "dash" Dim Separators() As Char = {"\"c, "."c} Sentence = FFN_wExt Words = Sentence.Split(Separators) Dim oWords As New ArrayList i = 0 For Each wrd In Words oWords.Add(wrd) i += 1 Next oCount = oWords.Count LFN_woExt = oWords(oCount-2) LFN_revNumber = iProperties.Value("Project", "Revision Number") revNumber_Edit = InputBox("REV. NUMBER (EDIT)", "EDIT", LFN_revNumber) LFN_revNumber = revNumber_Edit LFN_wRev = LFN_woExt & "-" & LFN_revNumber Dim optionsSave As New ArrayList oStp = ".stp" oIges = ".iges" oExit = "EXIT" optionsSave.Add(oStp) optionsSave.Add(oIges) optionsSave.Add(oExit) selectionSave = InputListBox("Prompt", optionsSave, optionsSave(0), Title := "FILE EXPORT", ListName := "List") If selectionSave = oExit Then Exit Sub If selectionSave = oSTP Then strFolder = saveFolderStp If selectionSave = oIgs Then strFolder = saveFolderIges saveCopyAs(FFN_wExt, strFolder, LFN_wRev, selectionSave) End Sub Sub saveCopyAs(FFN_wExt, strFolder, strFile, selectionSave) oFile = ThisApplication.Documents.Open(FFN_wExt, False) 'False/True: open the file is invisibe/visible oDoc = ThisDoc.Document xx = selectionSave Dim oFileDlg As inventor.FileDialog = Nothing InventorVb.Application.CreateFileDialog(oFileDlg) If xx = ".stp" Then oFileDlg.Filter = "STEP Files (*.stp; *.ste; *.step)|*.stp" ' Else If xx = ".ipt" Then' oFileDlg.Filter = "Autodesk Inventor Part Files (*.ipt)|*.ipt"' Else If xx = ".iam" Then' oFileDlg.Filter = "Autodesk Inventor Assembly Files (*.iam)|*.iam"' Else If xx = ".idw" Then' oFileDlg.Filter = "Autodesk Inventor Drawing Files (*.idw)|*.idw" Else If xx = ".iges" Then oFileDlg.Filter = "IGES Files (*.igs; *.ige; *.iges)|*.iges" End If oFileDlg.InitialDirectory = strFolder 'ThisDoc.WorkspacePath() oFileDlg.FileName = strFile 'iProperties.Value("Project", "Part Number") oFileDlg.CancelError = True On Error Resume Next oFileDlg.ShowSave() If Err.Number <> 0 Then MessageBox.Show("No File Saved.", "iLogic: Dialog Canceled") ElseIf oFileDlg.FileName <> "" Then MyFile = strFolder.FileName 'oFileDlg.FileName oDoc.SaveAs(MyFile, True) 'True = Save As Copy & False = Save As End If oFile.Close End Sub
Solved! Go to Solution.