I have multiple configuration locations. What would be the best way to switch between the configuration locations on the fly?
This can be done using the -WS command line argument. The following example can show how this can be used for this purpose.
Let us consider that there are two configuration locations on the D: drive (the configurations can reside on different drives, the path, used later, would change based on that), D:\CustomConfig1\ and D:\CustomConfig2\. Under each of these folders, there must be a Workspaces folder and an Organization folder. For this example, let us consider that we have the following folders in each of the above mentioned locations:
So, the folders would like these:
Under the CustomWorkspaces folder for each of the configuration locations, there should be the workspaces and their corresponding cfg files. In case otherwise, appropriate configuration variables should be modified correctly.
At this stage, there should be a configuration file that defines the Workspaces folder in this location for each of the configuration locations. We would need to add a cfg file and name it WorkSpaceSetup.cfg. This file should contain the following code:
#-------------------------------------------------------------------------------| # The following code is for configuring the Organization folder. This can vary | # depending on the name and the location of the Organization folder. In the | # following example, it is considered that _USTN_CONFIGURATION points to | # the CustomConfig1 or CustomConfig2 (whichever is applicable) folder and the | # Organization folder is under this folder with the name CustomOrg. | #-------------------------------------------------------------------------------| MY_ORGANIZATION_LOCATION = $(_USTN_CONFIGURATION)CustomOrg/ %if defined (MY_ORGANIZATION_LOCATION) && exists ($(MY_ORGANIZATION_LOCATION)) _USTN_ORGANIZATION = $(MY_ORGANIZATION_LOCATION) %endif #-------------------------------------------------------------------------------| # The following code takes care of the Workspaces location just as the previous | # one does for the Organization folder. The same considerations as above are | # made here as well. This can change depending on the folder structure. | #-------------------------------------------------------------------------------| MY_WORKSPACES_LOCATION = $(_USTN_CONFIGURATION)CustomWorkspaces/ %if defined (MY_WORKSPACES_LOCATION) && exists ($(MY_WORKSPACES_LOCATION)) _USTN_WORKSPACESROOT = $(MY_WORKSPACES_LOCATION) %endif
In addition to the above code, it can also contain further modifications in case the workspaces and their corresponding cfg files are not residing under the CustomWorkspaces (i.e., Workspaces) folder.
It might be noted at this point that we have considered that the configuration locations are being resolved by _USTN_CONFIGURATION. That is because of the following steps.
At this stage, we need to go to the installed configuration location, which is, typically, at C:\ProgramData\Bentley\OpenBuildings CONNECT Edition\Configuration\. We need to open the file called ConfigurationSetup.cfg and put a "#" before, typically, line number 21, which says "_USTN_CUSTOM_CONFIGURATION=". Then we would need to modify, typically, line number 26, so that the end result says, "_USTN_CONFIGURAITON = $(_USTN_CUSTOM_CONFIGURATION)"
The following image shows how it should look after the changes:
In the last part of this exercise, we need to create new shortcuts of OpenBuildings Designer on the Desktop for each of the configuration locations. For our example, we would need two. We need to go to the properties of each of the shortcuts and modify the Target field as follows:
After the modification, it should look like the following:
If all went well, double clicking the shortcuts would directly show the list to the workspaces and worksets that are available in the corresponding configuration folder.
Please Note: One of the few common reasons why this might not be working correctly is the configuration downstream from this point, e.g., configuration of the Workspaces, Worksets and their Standards. The second one would be typos while assigning paths to the variables.