Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

environmental variable and customization problems

Status
Not open for further replies.

quicova

Marine/Ocean
May 29, 2014
9
Hello, I'm having a go at setting environmental variables and start up scripts to set the templates on a server.

So I created a templates folder on the server, created the templates and changed the .pax files to suit.

Then I copy pasted the ugii_env.dat file to the server and added this line:
UGII_TEMPLATE_DIR= path to the templates folder

Then created a small script to launch NX that I will give to everyone using NX:

@echo off
set UGII_ENV_FILE=path to the ugii_env.dat on the server
start "" "C:\Program Files\Siemens\NX 9.0\UGII\ugraf.exe"

Now my question is, If anyone for some reason doesn't have access to the server because they are off site or working offline they can't access any of this things.
Can I write an IF statement on the launch script that if the ugii_env.dat is not found to use the standard NX setting in the root directory?
How do I do this?

Is there also a environmental variable to change the welcome screen to a different one?
I found this one: UGII_BACKGROUND_URL, but if the welcome help page is turned off it will not work
is there an environmental variable to turn that help welcome screen back on again?

Thanks so much
best regards

Francisco
 
Replies continue below

Recommended for you

Check if the file on the server is there before you set the ENV:

if EXIST "blah" (
set ...
) ELSE (
set ...
)

Mark Rief
NX CAM Customer Success
Siemens PLM Software
 
Franscico,

Another approach that may be more robust is to set UGII_ENV_FILE to a local file that performs the test of the networked file and if the network location is available uses the contents of the network file.

This insures that the variables will be used for NX from the shortcut and by all NX command line utilities and NX sessions launched by means other than the batch file/shortcut (e.g. windows explorer double click, etc.).

It gives the opportunity to have some variables set even if the network share is unavailable.

The local UGII_ENV_FILE would look something like this. (NX 9 implicitly processes the $UGII_BASE_DIR\ugii\ugii_env.dat file after the UGII_ENV_FILE (but there is no harm in explicitly adding that to the end of the local file to help depict the logic for the order of the files used))))

Code:
#if FILE server\share\file.ext
#include server\share\file.ext
#endif

## Other env vars if needed ...

#include ${UGII_BASE_DIR}\ugii\ugii_env.dat

HTH,

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor