NX Journal - Execute NXOpen DLL from within a VB.NET Journal
NX Journal - Execute NXOpen DLL from within a VB.NET Journal
(OP)
This might be a VB.NET question as opposed to an NX Journal specific question, but...
I am trying to call a standalone NXOpen DLL (that I would normally execute from File->Execute->NXOpen) from within an NX Journal. It is not supported by the journal record, so I am unsure how to do that.
For example (not real code):
Thanks,
Jeff
I am trying to call a standalone NXOpen DLL (that I would normally execute from File->Execute->NXOpen) from within an NX Journal. It is not supported by the journal record, so I am unsure how to do that.
For example (not real code):
CODE
... Module NXJournal Sub Main Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Dim lw As ListingWindow = theSession.ListingWindow Dim displayPart As Part = theSession.Parts.Display ... Execute C:\files\myNXOpen.dll ....
Thanks,
Jeff





RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
Jeff
RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
The DLL I wish to execute is an NXOpen DLL. Does that make a difference?
Jeff
RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
NXOpen.dll
NXOpen.Utilities.dll
NXOpenUI.dll
NXOpen.UF.dll
mscorlib.dll
System.dll
System.Windows.Forms.dll
System.Drawing.dll
if you need any other library compiling it is the only option, atleast as far as i know.
RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
You might find the following GTAC example helpful
CODE --> .NET
'' This example demonstrates launching another VB .NET application's Main entrypoint. '' The Launching application might look like this: Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Module NXJournal Sub Main() Dim s As Session = Session.GetSession() Dim ufs As UFSession = UFSession.GetUFSession() Dim lw As ListingWindow = s.ListingWindow lw.Open() Dim libname As String = "launch_it.dll" Dim fullpath As String = Nothing ufs.UF.FindFile("application", libname, fullpath) If fullpath Is Nothing Then lw.WriteLine("application\" & libname & " not found") Else Dim nada() As Object = {} ' Main doesn't take any arguments lw.WriteLine("Launcher will now attempt to Execute " & fullpath) s.Execute(fullpath, "NXJournal", "Main", nada) End If End Sub Function GetUnloadOption(ByVal arg As String) As Integer Return CType(Session.LibraryUnloadOption.Immediately, Integer) End Function End ModuleCODE --> .NET
''Where the application being launched might look like this: Option Strict Off Imports System Imports NXOpen Module NXJournal Sub Main() Dim s As Session = Session.GetSession() Dim lw As ListingWindow = s.ListingWindow lw.Open() lw.WriteLine(" launch_it is running") End Sub Function GetUnloadOption(ByVal arg As String) As Integer Return CType(Session.LibraryUnloadOption.Immediately, Integer) End Function End ModuleRE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
Unfortunately, I don't know any details about the DLL. When I look at it with DLL explorer the only functions listed are:
ufusr
ufusr_ask_unload
?NXSigningResource@@YAXXZ
My understanding is that this means it is a C DLL, and not a VB.NET DLL so I can't use the Execute method.
Jeff
RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
s.Execute("path\library.dll", "library", "CallUfusr", nada)
RE: NX Journal - Execute NXOpen DLL from within a VB.NET Journal
Jeff