Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

How to execute a .VB aoutside NX CAM?



Is there any way to combine Windows Task Scheduler 7 or 8.1, with attached .VB file

outside NX CAM?


I want to launch this .VB file outside NX and on an established day and hour, for postprocessing tasks.


Thanks in advance,

Accepted by topic author Igor
‎08-26-2015 04:32 AM

Re: How to execute a .VB aoutside NX CAM?

You could use "%UGII_ROOT_DIR%\run_journal.exe" to execute the journal.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 ( | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: How to execute a .VB aoutside NX CAM?

Hi Stefan,


So with a .BAT file with this estucture will work? But NX must be open.


"Call D:\Program Files\Siemens\NX 9.0\UGII\ run_journal.exe" C:\ Projects\NX journals\ Postmultiplegroups.vb"




Re: How to execute a .VB aoutside NX CAM?

An existing NX session does not have to be open. Run_journal.exe launches a new NX session


The following .bat contents works for me:


set NX_JOURNAL="C:\Projects\NX Journals\Postmultiplegroups.vb"

%UGII_ROOT_DIR%\run_journal.exe %NX_JOURNAL% -args arg1 arg2 arg3



Re: How to execute a .VB aoutside NX CAM?

Hi Jim,


I have next error whith the .BAT file, UI error line 32 on PostMultipleGroups.vb

and "compile fail".


Why is that?


Regards, Igor.

Re: How to execute a .VB aoutside NX CAM?

[ Edited ]

When running in batch mode, I don't think that you will have access to the NX UI. It is complaining that you are trying to access the UI.


Also, you will probably need to eliminate the references to the FolderBrowserDialog; if you are running in batch mode, you won't want (and probably can't have) this dialog popping up.


You will need to modify the journal a bit more to pass in the files you want to process as arguments:

Sub Main(byval args() as string)


then parse the file names from the 'args' array and process each accordingly. I think this functionality first appeared in NX 8.5 (or maybe 8?)

Re: How to execute a .VB aoutside NX CAM?

[ Edited ]

Hi cowski1,


I am not sure about the code, I upload the .bat file with .txt. I am trying to link this .bat file with PostMultipleGroups.vb journal.


Not sure if NX has to be open or not...


I am testing on Windows 7 and NX8.5 and Windows 8.1 and NX9.0.2

Re: How to execute a .VB aoutside NX CAM?

I did not understand "You could use "%UGII_ROOT_DIR%\run_journal.exe" to execute the journal." Could you point where should it to be write and run?