My company use the following batch file to start nx7.5
set UGII_BASE_DIR=C:\Program Files\UGS\NX 7.5
set UGII_ROOT_DIR=C:\Program Files\UGS\NX 7.5\UGII
start "tITLE" "%UGII_ROOT_DIR%\"ugraf.exe%*
Using windows 7, i can't double click to open part(i tried open with and pointing to the batch file with no succes, pointing to the standard exe doesn't open it too )
Please advice, thx.
Does it get far enough along to generate a log file?
I don't see UGS_LICENSE_SERVER defined in your .bat file - is it defined at the system (or user) level? If not, you might want to add it to see if that helps.
I'd do the following
1) Make sure no "echo off" exists in the .BAT - if it does, comment it out
2) Add a "Pause" after all the "Set" commands, also after the "Start"
If that doesn't help...
- Open up a command prompt window
- find a PRT file
- run the .bat with the part as a parameter, i.e.
c:\> C:\path\batfile.bat D:\path\filename.prt
(substituting drives/paths as needed)
You SHOULD get an error message at some point
all the "set" commands
-open sommand prompt
- do a "DIR [right side of set command]"
e.g. if set is
make sure all drives are mapped and paths correctly defined. I would use cut/paste instead of typing in the path to prevent un-intentionally fixing issues...
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
Checked all the path, no problem.
I wonder why not use start "tITLE" "%UGII_ROOT_DIR%\ugraf.exe"(i tried this and it can open the nx program too) for the last line, what is the %* means for(not really familiar with cmd symbol)?
Still, i can't use open with to open part with the batch together.
Using C:\batchPath.bat C:\partPath.prt result in the start "tITLE" "%UGII_ROOT_DIR%\ugraf.exe" concatenate with the C:\partPath.prt, which won't work.
There must be a UG way to use cmd to open the prt, something like C:\xx\ugraf.exe -open C:\xx.prt , no?
why do you need to use a batch to start NX?
You can set those variables in the ugii_env.dat (that's what the file's for).
That way the standard double click of the NX part file will launch the router to start NX with your part file and pick up the variables you've set.
Well, company policy so i don't want to mess around with the environment variable and registry.
I had tried the standard exe without using batch file , pointing "open with" to the ugraf.exe in my local program file disk, yield same result(UG started, without any part being opened).
In the NX documentation under Home => Fundamentals => Customizing NX => Launching NX => Windows platform you will find the command line switches available.
%* is the placeholder for all arguments submitted to the batch file.
Your posted code doesn't have a space between ugraf.exe and %*, so that is your main problem here.
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0
Employees of the customers, together we are strong
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide