×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Start a new session from NX Open?

Start a new session from NX Open?

Start a new session from NX Open?

(OP)
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
Session.GetSession() 
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:

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 

When I manually start two instances of NX and then run the Journal from each of them - the session's tag always is 10.
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

RE: Start a new session from NX Open?

I can't say if the sessions objects are unique or not, but I would not rely on the Tag to tell them apart.
If you open 2 interactive NX sessions and create 2 parts, one in each, the objects in those parts could have the same Tags (I believe). So I think the Tags for the session object could also be the same.
I think what I'm trying to say is that Tags are only unique within an NX session.

Graham Inchley, Systems Developer, Sandvik Coromant. www.sandvik.com
HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP4 64bit
Testing: NX9.0.2.5

RE: Start a new session from NX Open?

(OP)
That sounds quite reasonable bigsmile
Thank you for pointing that out, maybe I just haven't found a way to tell them apart correctly...

I will definitely experiment with that a little more, but I'm still wondering if there is a way to force a new session/UI window into existence ponder

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources