cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Can config.pro read environment variables?

pwilliams-3
11-Garnet

Can config.pro read environment variables?

Hi Everyone,

I see that the config.pro uses the $PRO_DIRECTORY environment variable. My question is can it read any variable that I define? If so, in what file would I set it so it would be read? The proe.bat or proe.psf? Does anyone have a working example?

Patrick Williams | Sr. Application Engineer | Engineering Systems | Steelcase Inc. | 616.698.4078





4 REPLIES 4

I tried the following example.



In proad.bat:

@echo off

set DM=no

C:\ptc\pro\bin\proe.exe C:\ptc\pro\bin\proad.psf %*



In config.pro

dm_remember_server $DM



Whenever I start Pro I still get a prompt to start Intralink. However
if I set dm_remember_server no in the config.pro I don't get prompted to
login to Intralink. Is this option special? Or did I make a mistake in
proad.bat with syntax? Or will only variables with paths be expanded in
the config.pro?



Patrick Williams | Sr. Application Engineer | Engineering Systems |
Steelcase Inc. | 616.698.4078 | My Site
<">http://my.steelcase.com/Person.aspx?accountname=NA\PWILLIA3>





My intent is to have dynamic map keys. For example, there is a mapkey
to start a drawing. In the config.win a menu pick points to the 'sd'
mapkey in the config.pro.



Now, in the config.pro there may be several ways to start a drawing.
Therefore there are mapkeys called 'sd1', 'sd2', 'sd3' for example. I
would like to set sd=$SD_VAR in the config.pro. Then in a batch file
set SD_VAR=sd1 (or sd2, sd3 etc...). Is this possible?





Patrick Williams | Sr. Application Engineer | Engineering Systems |
Steelcase Inc. | 616.698.4078 | My Site
<">http://my.steelcase.com/Person.aspx?accountname=NA\PWILLIA3>





Patrick,
Yes you can use any windows environment variable in your config.pro. What PTC doesn't tell you is that you need to use the UNIX syntax for environment variables in your config.pro, windows syntax will not work.

Config.pro syntax:
system_colors_file $HOMEDRIVE\$HOMEPATH\pro\wf4_home\syscol.scl
symbol_instance_palette_file $USERPROFILE\pro\wf4_home\draw_symbol_palette.drw.1


Startup script (MS Windows) syntax:
del "%USERPROFILE%\pro\wf4_home\*trail.*"
"P:\wf4-m060\proeWildfire 4.0\bin\proe1.bat"

One thing you will need to find out is if your admins have %HOMEDRIVE% mapped to a network drive. Sometimes they will use Active Directory to change the users homedrive homepath to a network resource and leave userprofile mapped to the local hard drive.

You can get a list of all the environment variables on your system and their values. Just type set without any arguments in a command shell.

David Haigh
Phone: 925-424-3931
Fax: 925-423-7496
Lawrence Livermore National Lab
7000 East Ave, L-362
Livermore, CA 94550

Hello Dave,

Smiley Happy

Really useful information, and it really works. I Set a "Creo_Lib" user variable and give it a path value, and use it in config.pro, to instead of those directory path, if i move all the lib folders i  just need to change the "Creo_Lib" value.

It saves me a lot of time.

 

Thank you.

--

Jeff

Top Tags