cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Journal files

Creator
Creator

Recording journals and running them for repeated tasks help a lot in savıng time. Journals are recorded and run when NX is Open. Is it possible to add lines to a journal code which will first run NX, and then run the recorded journal? 

 

If the answer is yes, how can this be triggered from outside?

3 REPLIES

Re: Triggering Journal files

Siemens Phenom Siemens Phenom
Siemens Phenom

You can do something similar using a utility program called run_journal.exe.

 

You should run it in an NX Command Prompt (start this from the NX Tools menu), and pass it the name of the .VB or .CS or .py file that you want to run.

 

This will start an invisible session of NX - there will be no user interface and no NX windows to look at - and it will execute your journal inside this "headless" session.

 

You can also use the -args switch to pass in information that the Journal will need.

 

Please see the example in the Solution Center called "open_part_from_command_line_argument.vb".  It demonstrates using run_journal, and passing the name of a file to open.

Re: Triggering Journal files

Creator
Creator

Thank you, i have the example now. I think this example shows how to open a part stored on the local drive. I would like to open  a part that is in Teamcenter. I think i need to write some path that directs to Teamcenter in the below line, but i don't know what. Can you also guide me with that?

 

("Part " + thePart.FullPath + " was opened successfully.")

Re: Triggering Journal files

Siemens Phenom Siemens Phenom
Siemens Phenom

 

To open a TC part, you will need to use the CLI format for the name, for example:

 

@db/1234567/A

 

You also need to use "-pim=yes" so that NX knows it should be working in a managed (TC) environment:

 

run_journal thisprogram.vb -pim=yes -u=user -p=password @DB/itemno/revno


 The shell window where you run this will need all of your TC vars defined, as well as all of your UGII and UGS and SPLM vars defined, and  it needs either UGII_ROOT_DIR or NXBIN on the FRONT of the path.  This is critical to avoid a library name collision between NX and TC.

 

If you are in any version up to and including NX10, once you have the other variables set, do this in your shell window:

 

set PATH=%UGII_ROOT_DIR%;%PATH%

 

In NX11:

 

set PATH=%UGII_BASE_DIR%\NXBIN;%PATH%