10-23-2023
11:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-23-2023
11:38 AM
Hi @brandon.lee97. Below is an example of a custom Function that you can include in your rule...after the Sub Main...your other code here...End Sub routine, then you can call this function to run from within your Sub Main area of code. But this example also includes an example Sub Main routine, just to show you how to use it, and what it returns. Most paths you get will not contain the final "\" character at the end, so keep that in mind when assembling a full file name using that returned path.
Sub Main
Dim sFolder As String = SelectFolder
MsgBox(sFolder,,"iLogic")
End Sub
Function SelectFolder(Optional oPrompt As String = vbNullString) As String
If oPrompt = "" Then oPrompt = "Select Folder"
Dim oFDialog As New System.Windows.Forms.FolderBrowserDialog
oFDialog.Description = oPrompt
oFDialog.ShowNewFolderButton = True
oFDialog.RootFolder = System.Environment.SpecialFolder.MyComputer
Dim oResult As System.Windows.Forms.DialogResult = oFDialog.ShowDialog()
If oResult = System.Windows.Forms.DialogResult.OK Then
Return oFDialog.SelectedPath
Else 'if dialog was canceled or something else
Return vbNullString
End If
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)
.
Wesley Crihfield
(Not an Autodesk Employee)