Cancel
Showing results for 
Search instead for 
Did you mean: 

Launching any windows script from postprocessor. e.g. C:\msg.vbs

Creator
Creator

Hi there! Could you please tell me if there is any way to start working win script after I launch postprocessing my program. Sorry if my questions is not understandable, just ask me something additional and I'll describe in details.

4 REPLIES

Re: Launching any windows script from postprocessor. e.g. C:\msg.vbs

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

you can use the exec command to start other scripts. For that just put the exec line in your proc in Postbuilder, e.g. in the start_of_program or somewhere else. I think there are many possibilities to do that and that is the native command. On the Tcl Wiki page you will find all the options you can do with this command.

 

Please not wondering about the LIB_ENTRY, it's just from Post Configurator to test it.

 

proc MOM_start_of_program_LIB_ENTRY {arg} {
switch $arg {
"start" {
exec "D:/Start NX.bat"}
}
}

 

Best regards

Thomas

Re: Launching any windows script from postprocessor. e.g. C:\msg.vbs

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Some cautions...

1) If you want to have the post TCL code wait until the script is done (for return status, or get feedback from the user, or whatever), you HAVE to do it the "right" way, or risk having your NX session lock up (i.e. you have to use Task Manager to kill NX, losing anything you haven't saved before posting!)

 

The SUPPORTED way to do this is found in %UGII_BASE_DIR%\POSTBUILD\pblib\custom_command\pb_cmd_ugwish_win64.tcl

 

Read and UNDERSTAND what they are doing.

 

2) If the code you are runnig is "fire and forget" (the post tcl code can continue running after the "exec", and the post does not care about any return status from the code), you can have a "&" at the end of the "exec" line.  This is works well, subject to the limitation of NO feedback to the post or NX.  I'm not sure if this is officially supported, but it works.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Launching any windows script from postprocessor. e.g. C:\msg.vbs

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The ampersand (&) is inherited from UNIX where it signals to have the process started in the background.

I did launch notepad with the generated shop documentation for easier printing in this way.

See Tcl/Tk 8.4 exec command reference for further information.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Launching any windows script from postprocessor. e.g. C:\msg.vbs

Creator
Creator

Thanks!I will try it as soon as I can and give feeedback if it works for me as solution

Learn online





Solution Information