Description
This document describes how to setup Creo Parametric and Windchill for use by more than one Windchill user on the same computer with the same Windows ID. This configuration is not required to use Windchill in a browser. It is only required when connecting Creo Parametric to Windchill for CAD Data Management.
NOTE: If you are using Creo Parametric and Windchill on your own computer with a single Windows account, you do not need to perform any of these actions.
Details
Lots of people have that unique situation where multiple people use the same computer with the same Windows user to run Creo Parametric. This is fine on its own, but when connecting Windchill, Windchill expects each user to authenticate from their own Windows ID for security purposes. If you are using one computer and one Windows ID for multiple people, you've probably run into issues where various users lose their CAD data or run into problems where they cannot connect to Windchill. This is typically caused by multiple Creo Parametric users connecting to Windchill and all working in a single local cahce (which is not how Windchill was designed to be used; the local cache should only belong to a single Windchill user).
To get around this, you can use the environment variables, PTC_WF_ROOT and PTC_WF_CACHE.
Manual Process
This manual process will help you understand the methodology for using PTC_WF_ROOT and PTC_WF_CACHE. If you would like a more automated method of doing this read this section ot familiarize yourself with the process and then check out the Automated Process.
You cannot set these variables globally because they need to be set for each Windchill user. You can do this manually by defining a unique cache folder for each user; ex. C:\Windchill\Scott. Create a unique folder for each user who will access Windchill from this computer. Do not use spaces in the folder path, it will make things more complex.
Now you can open a Command Prompt and set the environment variables.
- set PTC_WF_ROOT=C:\Windchill\Scott\.wf
- set PTC_WF_CACHE=C:\Windchill\Scott\local_cache
To make sure you've entered the right values, you can use the ECHO command to validate.
- echo %PTC_WF_ROOT%
- echo %PTC_WF_CACHE%
At this point, the trick is to start Creo from the same Command Prompt since the environment variables are only defined in the Command Prompt, not globally on the computer. If the Creo commands are not in your %PATH%, you'll need to enter the full path to the startup command. If that path contains spaces, you'll need to escape them with "" as shown below.
- "C:\Program Files\PTC\Creo 3.0\M040\Parametric\bin\parametric.exe"
Now that you've launched Creo, define your Windchill Server connection and choose a primary Workspace. To confirm you have set things up correctly, you should see new files added to the .wf and local_cache folders. Its important to note that none of these files should be manipulated manually. Creo and Windchill expect to find specific files in specific locations in these folders with specific content. You should never attempt to manually work with the files in these folders, just let Creo and Windchill do their thing.
Automated Process
Since we are just working with folder locations and environment variables, all this configuration and execution can be automated in a batch file (.bat). You can make a single batch file for each user or create a "smart" batch file that supports all the users. An example batch file is provided below. You can copy/paste the contents into a new batch file or download the attached file. The download will need to be renamed from .TXT to .BAT since most systems will not allow download of .BAT files.
The batch file is fully documented. You'll just need to make two changes in the INPUT Variables section to define the common Windchill folder you'll use for all Windchill users and the full path to you parametric.exe command. To personalize the batch file, change User1-User4 with the names of your Windchill users so they know which option to pick.
As a best practice, put the batch file in a secure location and put a shortcut on the Desktop or in your Start Menu to prevent people from inadvertently changing or removing it.
Enjoy!
@echo off
REM ================================================================
REM = Creo Parametric Startup Script for multiple Windchill users =
REM = =
REM = Ver Date Init Description =
REM = --- ----------- ---- ----------------------------------- =
REM = 1.0 18-OCT-2015 sm Created new batch file =
REM ================================================================
REM ===================== INPUT Variables ==========================
SET WCHOME=C:\Windchill
if NOT EXIST "%WCHOME%" goto wchome_not_set
SET CREO_CMD=C:\Program Files\PTC\Creo 3.0\M040\Parametric\bin\parametric.exe
if NOT EXIST "%CREO_CMD%" goto creo_parametric_error
REM ===== * USER CONFIGURATION * =====
REM Set WCHOME to the common WC user folder on your computer
REM Set CREO_CMD to the full path to your parametric.exe command
REM === * END USER CONFIGURATION * ===
:LOOP
ECHO.
ECHO Who are you?
ECHO.
ECHO 1. User1
ECHO 2. User2
ECHO 3. User3
ECHO 4. User4
ECHO.
ECHO Q. QUIT
ECHO.
REM ===== * USER CONFIGURATION * =====
REM Change User1 - User4 to the actual names of your Windchill users
REM Remove entries if you do not need them
REM Add new entries if you need them, but they will need to be added
REM to the User Selection section below to work properly
REM === * END USER CONFIGURATION * ===
:: SET /P prompts for input and sets the variable to whatever the user types
SET Choice=
SET /P Choice=Enter choice and press Enter:
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
REM ==================== End INPUT Variables =======================
REM =================== Start User Selection =======================
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='1' set USER=User1& GOTO LaunchCreo
IF /I '%Choice%'=='2' set USER=User2& GOTO LaunchCreo
IF /I '%Choice%'=='3' set USER=User3& GOTO LaunchCreo
IF /I '%Choice%'=='4' set USER=User4& GOTO LaunchCreo
IF /I '%Choice%'=='Q' GOTO End
ECHO "%Choice%" is not valid. Please try again.
ECHO.
ECHO %USER%-%USER%
GOTO Loop
REM ==================== End User Selection ========================
REM ===================== Start Launch Creo ========================
:LaunchCreo
@echo off
REM Set environment variables based on user selection
set PTC_WF_ROOT=%WCHOME\%USER%\.wf
set PTC_WF_CACHE=%WCHOME\%USER%\local_cache
if NOT EXIST "%WCHOME%\%USER%" goto wchome_not_set
REM Start Creo Parametric
ECHO Starting Creo Parametric as %USER% in %WCHOME%\%USER%...
CALL "%CREO_CMD%"
GOTO end_script
REM ====================== End Launch Creo =========================
REM ==================== Start Error Handling ======================
:End
set choice=
GOTO end_script
:creo_parametric_error
echo Error: Failed to find Creo Parametric command at: %CREO_CMD%
echo Verify that CREO_CMD has been set properly.
GOTO end_script
:wchome_not_set
echo Error: Failed to locate %USER% folder at: %WCHOME%
echo Verify that %WCHOME%\%USER% has been set up properly.
:end_script
REM ==================== End Error Handling ========================