@FINET_Laurent
That is a decent solution. I will keep that in mind. Thank you
@J-Camper
I guess I am miss interpreting how to use this line of code. I am running 2019 and i am using Ilogic to run this code. When I run the system.environment version I get a message box :

Then I get the error after selecting OK.

From what I can tell it is referencing the desktop but not the specific folder I need. If I am right, I don't know how to add this.
Bellow is the code I am using:
'Imports System.Windows.Forms
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument
'If document is not assembly, alert user and exit rule
If oDoc.DocumentType <> kAssemblyDocumentObject Then
MessageBox.Show("This rule must be run from an Assembly.", "iLogic")
Exit Sub
End If
'get user input
RUsure = MessageBox.Show ( _
"This will create a DXF file for all sheet metal components." _
& vbLf & " " _
& vbLf & "Are you sure you want to create a DXF for all of the sheet metal components in this assembly?", "iLogic - Generate DXF's ",MessageBoxButtons.YesNo)
If RUsure = vbNo Then
Return
Else
End If
'- - - - - - - - - - - - -Establish DXF Save Path - - - - - - - - - - - -
' Define folder browse dialog
'Dim Dialog = New FolderBrowserDialog()
' Set options for folder browser dialog
'Dialog.SelectedPath = oPath
'Dialog.ShowNewFolderButton = True
'Dialog.Description = "Choose Folder for Export..."
' Show dialog box
'If DialogResult.OK = Dialog.ShowDialog() Then
' User clicked 'ok' on dialog box - capture the export path
' oPath = Dialog.SelectedPath & "\"
'Else
' User clicked 'cancel' on dialog box - exit
' Return
'End If
oPath = MessageBox.Show(System.Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory), "DXFs")
'- - - - - - - - - - - - -Components - - - - - - - - - - - -
Dim oRefDocs As DocumentsEnumerator
Dim oRefDoc As Document
oRefDocs = oDoc.AllReferencedDocuments
'Iterate through referenced docs
For Each oRefDoc In oRefDocs
Dim oCurFile As Document 'current file
Try
oCurFile = ThisApplication.Documents.Open(oRefDoc.FullFileName, False)
'False == open invisible, True == open visible. invisible is much faster.
Catch
GoTo NextIteration
End Try
If oCurFile.DocumentSubType.DocumentSubTypeID <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
'document is not sheet metal.
oCurFile.Close(True) 'True == skip save
Else
oCurFileName = oCurFile.FullFileName
'get the postion of the last backslash in the path
FNamePos = InStrRev(oCurFileName, "\", -1)
'get the file name with the file extension
FName = Right(oCurFileName, Len(oCurFileName) - FNamePos)
'get the file name (without extension)
FName = Left(FName, Len(FName) - 4)
'set dxf filename
DxfName = oPath & FName & ".dxf"
Dim oSMCD As SheetMetalComponentDefinition
oSMCD = oCurFile.ComponentDefinition
If oSMCD.HasFlatPattern = False Then 'If it doesn't have a flat pattern, create one (unfold the model)
oSMCD.Unfold()
Else
oSMCD.FlatPattern.ExitEdit()
End If
'set dxf options
Dim sOut As String
sOut = "FLAT PATTERN DXF?AcadVersion=2004&RebaseGeometry=True&OuterProfileLayer=0&OuterProfileLayerColor=0;0;0&InteriorProfilesLayer=0&InteriorProfilesLayerColor=0;0;0&InvisibleLayers=IV_ARC_CENTERS;IV_TANGENT;IV_ROLL;IV_ROLL_TANGENT;IV_ALTREP_BACK;IV_ALTREP_FRONT;IV_FEATURE_PROFILES_DOWN;IV_FEATURE_PROFILES;IV_TOOL_CENTER_DOWN;DIGI_MARKER_TOOL_1;DIGI_MARKER_TOOL_2;IV_BEND;IV_BEND_DOWN"
Call oSMCD.DataIO.WriteDataToFile(sOut, DxfName) 'save the dxf
oSMCD.FlatPattern.ExitEdit
oCurFile.Close
End If
NextIteration:
Next
'- - - - - - - Display Results - - - - - - - - - - - - -
'MessageBox.Show("New Files Created in: " & vbLf & oPath & vbLf & vbLf & "Please verify that all DXFs are correct.", "iLogic")
'open the folder where the new files are saved
Shell("explorer.exe " & oPath,vbNormalFocus)