Since I’ve started working on my own again, I’ve had a chance to update my startup script from long ago. Here’s what I’m trying to do:
- Make a script that works for multiple versions and multiple clients
- Create a simple directory structure for project management
- Maximize script flexibility with system variables
Here’s how “prostart.bat” works:
- Pro/E is installed in directories by version, e.g. D:\PTC\WF2, D:\PTC\WF3, D:\PTC\WF4
- Pro/E startup commands correspond to version, e.g. WF2.bat, WF3.bat, WF4.bat
- The Windows shortcut supplies values to three variables: $VERSION, $CONFIG, $PROJECT
- Startup directories vary by project and provide last level of config control
- A startup trail file directs user to personal working directory
- The config.pro uses $CONFIG variable to provide flexibility for multiple projects and configs
Shortcut command line:
path_to_startup_batch_dir\prostart.bat version path_to_config_dir path_to_project_dir
Shortcut startup directory: blank because script changes directory to $PROJECT
Simple startup batch file:
@echo off
rem version will come from startup parameter, useful for multiple versions
set VERSION=%1
rem $CONFIG points to config files
set CONFIG=%2
rem $PROJECT is team working directory
set PROJECT=%3
rem Change startup directory according to shortcut, could add configs here
cd /d %PROJECT%
rem Create user work directory below project main directory
set WORKDIR=%PROJECT%\%USERNAME%
rem startup.txt is trail file to change working directory to $WORKDIR and instigate the open file dialogue box
call "D:\PTC\%1\bin\%1.bat" %CONFIG%\startup.txt
Simple startup trail file that still works in WF4:
!trail file version No. 1029
!Pro/ENGINEER TM Release 20.0 (c) 1988-98 by Parametric Technology Corporation All Rights Reserved.
~ Activate `main_dlg_cur` `main_dlg_cur`
~ Select `main_dlg_cur` `MenuBar1` \
1 `File`
~ Close `main_dlg_cur` `MenuBar1`
~ Activate `main_dlg_cur` `File.wd`
~ Select `main_dlg_cur` `MenuBar1` \
1 `File`
~ Close `main_dlg_cur` `MenuBar1`
~ Activate `main_dlg_cur` `File.psh_working_dir`
~ Update `file_open` `Inputname` \
`$WORKDIR`
~ Activate `file_open` `Open`
~ Activate `main_dlg_cur` `ProCmdModelOpen.file`
Also.
There’s a default config.pro setting: “search_path_file $PROJECT”. Each project can create a subdirectory of reference parts, multiple user subdirectories, and a vault.
And..
I still prefer to install Pro/E outside the Windows “Program Files” hierarchy. PTC may feel the need to comply with M$oft programming guidelines, but I remember PTC’s early problems with spaces in directory names. A side benefit of a separate install location (like D:\PTC) is that I don’t compete with permission enforcement for program directories, and I can do remote installs with simple scripts.
And…
You don’t need Pro/E on your Windows path. If you’re running multiple versions, it’s better that you don’t. If your life depends on “ptcstatus”, create a Windows shortcut.