Cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a .VB aoutside NX CAM?

Genius
Genius

Hi,

 

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,

7 REPLIES

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

Esteemed Contributor
Esteemed Contributor

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 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

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

Genius
Genius

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"

 

 

Thanks.

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

Siemens Phenom Siemens Phenom
Siemens Phenom

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?

Genius
Genius

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?

Honored Contributor
Honored Contributor

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?

Genius
Genius

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?

Creator
Creator
Hello,
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?
Thanks