Hallo,
ich habe folgendes Problem.
In ein aufgenommenes Journal möchte ich manuell über ein Pop up Fenster meinen Dateipfad auswählen können.
In meinem Fall möchte ich über ein Journal ein Bauteil laden und es anschließend bearbeiten. Hierzu soll der Benutzer anschließend den Dateipfad des zu ladenden Teils manuell auswählen können. Anschließend soll das Journal weiterlaufen.
Da ich mich mit diesem Thema noch gar nicht auskenne hoffe und bitte ich um eure Hilfe.
Folgenden Code habe ich für ein Pop up Fenster gefunden:
Option Strict Off
Imports System
Imports System.IO
Imports System.Collections.Generic
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.UF
Module Test
Dim theSession As Session = Session.GetSession
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim LW As ListingWindow = theSession.ListingWindow
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim initialPart As Part = theSession.Parts.Display
Dim nTotalPartFiles As Integer = 0
Sub Main()
Dim strOutputFolder As String
LW.Open()
Dim FolderBrowserDialog1 As New FolderBrowserDialog
' Change the .SelectedPath property to the default location
With FolderBrowserDialog1
' Desktop is the root folder in the dialog.
.RootFolder = Environment.SpecialFolder.Desktop
' Change the following line to default to a given path
.SelectedPath = "C:\"
' Prompt the user with a custom message.
.Description = "Select the directory to scan"
If .ShowDialog = DialogResult.OK Then
' Display the selected folder if the user clicked on the OK button.
'msgbox(.SelectedPath)
strOutputFolder = .SelectedPath
Else
'user pressed "cancel", exit the journal
Exit Sub
End If
End With
Exit Sub
End Sub
End Module
Aber wie und wo ich es einbinden kann hab ich noch nicht rausgefunden.
Ich hoffe auf eure Hilfe!
Grüße
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP