The Build - Part 2 - All Aboard the cfg Ride

As we get into the build configs, you'll start to see why the set up of the appl config is so important. Just to remind you, check out:

As we do have a development build and a live build I do have a copy of each appl file kept in each build due to the different names of the build locations. This is critical in:

netwrk_bld = Z:/_CADDdev/Bentley/Standard/
local_bld = C:/_CADDdev/Bentley/Standard/

as defined in the appl cfg file.

While splitting out the config files does make it easier for us to debug the build, the key to the ordering or the files is to make sure you have anything that can be overwritten from the standard build by client or project configs loaded first, and then fixed standard files last. Check out figure 3 in:

You'll get a better idea of how this works as we go.


This is where I set all my variables for the location of standard directories as they are used right throughout the other variables in the build. Some of these are the location for the site build:

# Set Site Workspace Directories

SITE_WORKSPACE = $(base_dir)Site/$(STD_MS)/

These are then used to set the location of the client and project build locations:



ClientDir = $(STD_CLIENT)$(Client)/

ProjectDir = $(STD_PROJECT)$(Project)/


This is where I set all the standard variables for the builds. Cells, dgnlibs, guidgnlibs etc. 


Funny thingis I have quite a large viz build. So much so that I like to keep it in it's own cfg file, but you'd don't have to go that far.


OK, time for some smoke and mirrors. 

In all seriousness, the include order of variables in this file is important to how you cascade your build. Remember, I don't use any pcf files and I only use the ucf files for minor additions set by the build. All of this is possible by this file. 

The first thing to do is include your 'Site' cfg files so that the office variables\tools are included:

%if exists ($(SITE_STDS))
%include $(SITE_STDS)*.cfg

Now that the office extras are included I look for a project cfg file:

%if exists ($(STD_PROJECT)$(PROJECT).cfg)
%include $(STD_PROJECT)$(Project).cfg

The reason I do this and not add a client cfg is that I need to keep the ability to be able to run the standard build for projects in a client area. In a lot of cases the <project>.cfg file will only have a few lines:

Client = BHPBIO

%include $(ClientDir)$(Client).cfg

Any variables that I need in the project that are different to the client build can then be added.

By following this flow of variables, what we have created is a build that delivers the standard build that can be overwritten or appended at the site\client\project level without the load order issues associated with pcf files. A very important key to me.

What this does mean is that, from time to time, we may need to tweak client builds to have them work in our cascading environment. Once you get the hang of it it's not hard to do and means you can include your interface tools in every client or project environment. One very good way to help you manage this is to use 'named expressions' to turn off key components of the GUI, nice little hook for something we'll look at in future articles.


This file is used to set the location for all standard build reference directories.

%if exists ($(Proj_Drv)COMMON/)

%if exists ($(CADDIR)00_RW/)
MS_RFDIR > $(CADDIR)00_RW/03_Models/
MS_RFDIR > $(CADDIR)00_RW/05_Common/
MS_RFDIR > $(CADDIR)00_RW/12_Ref/

The thing to be aware of here is that you don't use '='. The reason for this is that '=' is used to initially define a variable and all we want to do at this stage is append to MS_RFDIR variable. By doing this it means that no matter what is set in the standard\site\client\project configs, these paths will always be included.


In this files I set all my variables for the standard location and loads for mdl, vb etc. that are delivered with the standard build. Again, we don't use '=' as we always want these appended to the end of all other builds. This means we always have access to our standard delivered tools and means that we don't have to copy files into client and project build just to be able to use them.


I like to make sure all my user data is located where I ant it, as such I have everything I need in this cfg file. First thing to do is set the location of user files:

%if exists (C:/Apps/User/$(USERNAME))
STD_USER = H:/Bentley/

Now I'll set that user variables based on the ucf file existing in this location. For all of my users, this area is located and populated by the batch files run from the hta on run or from login scripts:

%if exists ($(STD_USER)$(USERNAME)_$(STD_MS).ucf)

Now to set the location and naming for other files, including a user AccuDraw text file and a user guidgnlib file:

%if exists ($(STD_USER)accudraw_$(STD_MS).key)


MS_FKEYMNU = $(STD_USER)personal_$(STD_MS).mnu

MS_GUIDGNLIBLIST > $(STD_USER)$(username)_$(STD_MS).dgnlib







This last file in the list is a VERY handy little addition and has fixed a LOT of headaches for me. I've always had issues with users being able to edit variables via the menus in MicroStation and trying to lock variables in builds is always a pain as you want to lock them in the standard build, but be able to edit them in client and project build. 

Well, fear now more. The beauty of the load order with these cfg files and the way we cascade the inclusions means we can run this last file to lock and and all variables, if that's what you want, which means that they cannot be changed from within MicroStation:

%lock MS_RFDIR

Short of locking permission access to all ucf files, you'll never stop the fiddlers, but this means that the 90% of those who will play from within MicroStation are now locked out. A major time saver when it comes to build and user support.

Well, got a headache yet :-) I know this does seem like a lot to digest, but a few basic principles in this article are going to change the way you deliver company builds. We're not finished just yet as we can now look at how we add the builds for our other apps like Structural Modeller, AECOsim and more, but there's a lot to digest to start with so.........

More soon.