MicroStation V8i (SS3) using %if exists variable with spaces in the variable

I am not well versed in using expressions in the configuration files…

I have added this line to my User Configuration File – which allow me to access my networked MicroStation V8i (SS2) workspaces while using MicroStation V8i (SS3):

_USTN_SYSTEM_GUIDGNLIBLIST < C:/ProgramData/Bentley/MicroStation V8i (SELECTseries)/WorkSpace/System/GUI/*dgnlib

This works OK... but I do not want to modify everyone's UCF.

I want to add this configuration variable to my site configuration files (1 cfg file for each office location) so that if MicroStation determines that it is running MicroStation V8i (SS3) to load this variable and if MicroStation determines that it is running MicroStation V8i (SS2), ignore this variable.  

I have determined that there only a few differences (files/folders) between the default installs of MicroStation V8i (SS2) and MicroStation V8i (SS3).

There is a folder/file that exists on the local machine if MicroStation V8i (SS3) is installed – and does not exist if MicroStation V8i (SS2) is installed:

C:\ProgramData\Bentley\MicroStation V8i (SELECTseries)\WorkSpace\System\GUI\GUI.dgnlib

Here is what I am attempting to do in my Site Configuration File (currently testing in my User Configuration File):

%if exists ("C:/ProgramData/Bentley/MicroStation V8i (SELECTseries)/WorkSpace/System/GUI/gui.dgnlib")

               _USTN_SYSTEM_GUIDGNLIBLIST < C:/ProgramData/Bentley/MicroStation V8i (SELECTseries)/WorkSpace/System/GUI/*dgnlib

%endif

This does not work - I simply just get an error when starting MicroStation - when it hits the %if exists line.

I think this has to do with either the C:\ProgramData folder is a “hidden” folder (by default) or that there are spaces in the variable that are not being addressed by the “quotes”. I have tried this with and without the "quotes" - no difference.

So as a test, if I copy the gui.dgnlib file to C:\temp\, the following works correctly:

%if exists (C:/Temp/gui.dgnlib)

               _USTN_SYSTEM_GUIDGNLIBLIST < C:/ProgramData/Bentley/MicroStation V8i (SELECTseries)/WorkSpace/System/GUI/*dgnlib

%endif

So this tells me that my idea works and this variable is loaded when starting MicroStation v8i (SS3).

So as another test, if I copy the gui.dgnlib file to C:\ProgramData\Bentley\, the following works correctly:

%if exists (C:/ProgramData/Bentley/gui.dgnlib)

               _USTN_SYSTEM_GUIDGNLIBLIST < C:/ProgramData/Bentley/MicroStation V8i (SELECTseries)/WorkSpace/System/GUI/*dgnlib

%endif

So this tells me there is no issue with ”Program Data” being a hidden directory.

So as another test, I created my own MicroStation folder without the spaces before and after "V8i" - and this also works correctly:

%if exists (C:/ProgramData/Bentley/MicroStationV8i(SELECTseries)/WorkSpace/System/GUI/gui.dgnlib)

               _USTN_SYSTEM_GUIDGNLIBLIST < C:/ProgramData/Bentley/MicroStation V8i (SELECTseries)/WorkSpace/System/GUI/*dgnlib

%endif

As soon as I add any path that has any spaces in it, the variable no longer functions correctly.

Any ideas to get the syntax correct when using spaces?

Thanks!

David Allen

Parents Reply Children