We use PCF files to load client workspaces. Some clients use autoload VBA files. So when launching Power InRoads, the last UCF file used loads the last PCF file used. If a user changes projects before opening a file, some of the initial client's VBA files remain loaded and to clear them completely, it is really necessary to exit after opening a file with the new project and restart with the new project being the default project.
So I began experimenting with -wp command line switches to see if a front end that selects the project before launching Power InRoads could force the desired project to load. Some of our PCF files have spaces in their filenames. So I have tried "-wpfile name with spaces" and -wp"file name with spaces" and am getting inconsistent results.
Sometimes the desired project comes up in the MicroStation manager and other times NoProject comes up.
Is there anything different that I need to do to get this to work 100% of the time.
BTW, I am using AutoHotKey as my front end. I have an icon on my taskbar that opens a popup menu with the choices for various projects. Here is the AHK code:
Menu, Launch_Menu, Add, Power InRoads V8i Ss2 , Launch_Menu_Handler Menu, Launch_Menu, Add, Power InRoads V8i Ss2 - MD SHA , Launch_Menu_Handler Menu, Launch_Menu, Add, Power InRoads V8i Ss2 - AEC R6 , Launch_Menu_Handler Menu, Launch_Menu, Show Launch_Menu_Handler: { If ( A_ThisMenuItem = "Power InRoads V8i Ss2" ) { Run, "C:\Program Files (x86)\Bentley\PowerInRoads V8i\PowerInRoads\PowerInRoads.exe" } Else If ( A_ThisMenuItem = "Power InRoads V8i Ss2 - MD SHA" ) {
; This one correctly loads the PCF file Run, "C:\Program Files (x86)\Bentley\PowerInRoads V8i\PowerInRoads\PowerInRoads.exe" "-wpMD SHA V8+ 2013 Design" } Else If ( A_ThisMenuItem = "Power InRoads V8i Ss2 - AEC R6" ) {
; This one ends up with No Project as the project, but it also resulted with No Project when it used "-wpAEC Release 6-Civil Design" Run, "C:\Program Files (x86)\Bentley\PowerInRoads V8i\PowerInRoads\PowerInRoads.exe" -wp"AEC Release 6-Civil Design" } ExitApp } Return