Submitted by MARTYNW on Thu, 10/16/2014 - 03:34
Forums:
Does anyone know of a way to open a Windows folder from NX, possible with a Journal.
I need a window open to enable me to drag and drop something,
Does anyone know of a way to open a Windows folder from NX, possible with a Journal.
I need a window open to enable me to drag and drop something,
re: open folder
Change the "myFolder" variable to reference your folder of choice.
Option Strict Off
Imports System
Imports NXOpen
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
Dim myFolder As String
' change the "myFolder" variable to point to your folder of choice
myFolder = My.Computer.FileSystem.SpecialDirectories.MyDocuments
'myFolder = "C:\Temp"
'myFolder = "C:\path\to\your\folder"
Try
System.Diagnostics.Process.Start("explorer.exe", myFolder)
Catch ex As Exception
MsgBox(ex.Message)
Finally
End Try
lw.Close()
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
End Function
End Module
nice
that is what I need to find and open the folder storing the dialog-favorites :)
thanks!!!