Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: brandon.lee97

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) :thumbs_up:.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)