MarcusMang
Automotive
- Jul 17, 2015
- 3
Hi everybody!
Since first dipping my toe into the NX Open water, I always wondered if there was a way to start a new session from an NX Open stand-alone executable?
I know I can do [pre]Session.GetSession()[/pre] but this will always attach to the same session when starting multiple instances of my executable.
(The first call will start, let's say, Session 10 and then all subsequent calls will also get me this session.)
I just conducted a little experiment with a simple Journal:
[pre]Option Strict Off
Imports System
Imports System.Windows.Forms
Imports NXOpen
Module RenameToolboxParameters
Sub Main(ByVal args() As String)
MessageBox.Show(Session.GetSession().Tag.ToString())
End Sub
End Module[/pre]
When I manually start two instances of NX and then run the Journal from each of them - the session's tag always is [tt]10[/tt].
I expected to get a different session (and thus tag) when running the Journal from the second instance.
To me it seems, that even when starting two UI instances, I still have only one session available through NX Open.
Is this the case? Or am I missing something?
If so, does somebody have deeper insight into sessions/UI sessions?
(Even starting a UI session from an NX Open executable (started via NX command line) would be very, very interesting!)
I'm really looking forward to your answers and hope I somehow made my question clear
Thanks in advance!
Marcus
Since first dipping my toe into the NX Open water, I always wondered if there was a way to start a new session from an NX Open stand-alone executable?
I know I can do [pre]Session.GetSession()[/pre] but this will always attach to the same session when starting multiple instances of my executable.
(The first call will start, let's say, Session 10 and then all subsequent calls will also get me this session.)
I just conducted a little experiment with a simple Journal:
[pre]Option Strict Off
Imports System
Imports System.Windows.Forms
Imports NXOpen
Module RenameToolboxParameters
Sub Main(ByVal args() As String)
MessageBox.Show(Session.GetSession().Tag.ToString())
End Sub
End Module[/pre]
When I manually start two instances of NX and then run the Journal from each of them - the session's tag always is [tt]10[/tt].
I expected to get a different session (and thus tag) when running the Journal from the second instance.
To me it seems, that even when starting two UI instances, I still have only one session available through NX Open.
Is this the case? Or am I missing something?
If so, does somebody have deeper insight into sessions/UI sessions?
(Even starting a UI session from an NX Open executable (started via NX command line) would be very, very interesting!)
I'm really looking forward to your answers and hope I somehow made my question clear
Thanks in advance!
Marcus