03-22-2022
06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-22-2022
06:25 AM
Hi @nowell.colsenXK53F. Just in case you were looking for more of a file dialog, so that you can select a file, instead of the Pick function, some code like this might be useful to you. It is a simple custom Function with no 'input' variables, that will open a file dialog (just like when you use Inventor's Open dialog), but it doesn't actually open the selected file. Instead it just returns the full file name of the selected file.
Sub Main
oFileName = SelectFile
MsgBox("oFileName = " & oFileName,,"")
End Sub
Function SelectFile() As String
Dim oFileDialog As Inventor.FileDialog
ThisApplication.CreateFileDialog(oFileDialog)
oFileDialog.DialogTitle = "Select A File."
oFileDialog.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
oFileDialog.Filter = "Autodesk Inventor Files (*.iam;*.dwg;*.idw;*.ipt:*.ipn;*.ide) | *.iam;*.dwg;*.idw;*ipt;*.ipn;*.ide | All files (*.*)|*.*"
oFileDialog.MultiSelectEnabled = False
oFileDialog.OptionsEnabled = False
oFileDialog.InsertMode = False
oFileDialog.CancelError = True
Try
oFileDialog.ShowOpen
Return oFileDialog.FileName
Catch
Return ""
End Try
End Function
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS)
.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :bulb: or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)