The Build - Part 4 - All Aboard the cfg Ride - Including Other Apps

Now that we have the base to build from, how do we go about including other Bentley application as well as other apps from vendors like Axiom etc.? 

Well, it's all about order, load and line order to be more precise. What we need to think through it whether an app is global (for all users), local (just for the office) or something that we need to be able to have overwritten or appended at the client or project level. this is all done in the:

STD_40_Inclusions.cfg

that we looked at in the last article. The lines that are important here are:

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

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

Where you put your include statements in this file will be directly effected by these lines. For instance, lets take it that we have the Axiom products in the company list. I'm a fussy bugger when it comes to menu and GUI order so I want my company\site\client\project gui to load first and then any app gui to load last. Again, remembering load order and how the configs run, this means I must have my Axiom cfg include statement after my site and project includes:

#---------------------------------------------------------------------------
# Axiom
#---------------------------------------------------------------------------
STD_AXIOM_V8 = $(build_drv)$(STD_MS)/Axiom/V8/
%include $(STD_AXIOM_V8)/Axiom.cfg

Easy enough to do, but how do I go about loading my Bentley apps using this same build. At the moment all we do is cater for MicroStation?

It may look that way, but the hta file has been designed so that it copies the appl cfg file into any app that is started by tha hta buttons. This means we can control it in the same build. Again, load order is important so think carefully before adding your include statements.

For most products like Structural Modeller, AECOsim, Bentley Map etc. we are simply changing the location of the used files to our build. I don't usually have separate gui builds for apps as I control them in the main build using named expressions (more on that another time) so they way to do this is to have the include statement at the start of the inclusion file so they are picked up early:

%include $(STD_APPS_CFGDIR)*.cfg

As with the site and standard cfg's I number and name for ease of debugging.

See Figure 5 at:

http://communities.bentley.com/communities/everything_else_community/f/289/p/80292/221859.aspx#221859

I know, I know, you don't want the error issues with these files when you start other applications. Easy, this is where trigger statements are going to be a life saver. What I means is that these files will only run the contents if a certain variable has been defined. In the case of Structural Modeller I use:

%if defined (STFDIR_PREFS)

This means that the lines below this will only run if that variable is defined which is only when Structural Modeller has been started. The thing to be careful of here is that you must close the statement by having the last line as:

%endif

Also remember to have a blank line after your last populated line in a cfg file or it will not run properly. Trick for new players.

This method can be used for just about any bolt on application within the Bentley system. Now you can start to see the real power of the build.

With any of these apps there is always an exception to the rules and the last example I want to go through does provide a few challenges, but can be run from the same system with a bit of thought. Navigator is one of the few apps that is that exception to the rule in the way it runs, but that doesn't mean we want to reinvent the wheel when it comes to how it picks up level libraries and others. Due to it's uniqueness, I keep the Navigator cfg's in with the Navigator and include it last in the list so I can overwrite gui files that are only relevant to MicroStation and it's other apps. 

The way I do this is to use:

#---------------------------------------------------------------------------
# Navigator
#---------------------------------------------------------------------------
STD_NAV = $(build_drv)$(STD_MS)/Navigator/
STD_NAV_CFG = $(STD_NAV)Cfg/

%if defined (_NAVIGATOR)
#STD_STD_NAV = $(build_drv)$(STD_MS)Navigator/Cfg/
%include $(STD_NAV_CFG)*.cfg
%endif

This now allows me to call up directories that designers wouldn't need in the standard MS_RFDIR list, redefine the gui to one designed for Navigator and more. an example of this file is included below:

%if defined (_NAVIGATOR)

CAL_NAV = 1

%undef MS_GUIDGNLIBLIST
MS_GUIDGNLIBLIST = $(STD_NAV)dgnlib/navigator.dgnlib
%lock MS_GUIDGNLIBLIST

REDLINE_NONSTD = 12_Redline

MS_TASKMAPFILES = $(STD_NAV)data/MarkupTaskMap.xml

%if exists (${CADDIR}${REDLINE_NONSTD}/.)
MS_MARKUPPATH = $(CADDIR)12_Redline/
%endif

%if exists (${CADDIR}12_Redline/.)
MS_MARKUPPATH = $(CADDIR)12_Redline/
%endif

#MS_MARKUPPATH = $(CADDIR)12_Redline/
MS_MARKUPSHEETSEED = $(STD_NAV)dgnlib/PageLayout.dgnlib
MS_MARKUPSHEETSEEDNAME = A3 (Landscape)
MS_MARKUPVIEWRESOLUTION = 500
MS_HANDLER_LOAD > markuphandler;Bentley.Markup.ContentAreaHandler.ma
MS_SYMBOLPROVIDER_APPS < markup

_USTN_LOCALUSERTEMPPATH = C:/PDF/

MS_TMP = $(MS_MARKUPPATH)

MS_RFDIR > $(CADDIR)05_S/01_Drgs/;$(CADDIR)00_RW/01_Drgs/;$(CADDIR)01_C/01_Drgs/;$(CADDIR)02_E/01_Drgs/;$(CADDIR)03_M/01_Drgs/;$(CADDIR)04_P/01_Drgs/;$(CADDIR)06_G/01_Drgs/;$(CADDIR)07_Y/01_Drgs/;$(CADDIR)08_A/01_Drgs/
MS_RFDIR > $(CADDIR)05_S/14_Sketches/;$(CADDIR)00_RW/14_Sketches/;$(CADDIR)01_C/14_Sketches/;$(CADDIR)02_E/14_Sketches/;$(CADDIR)03_M/14_Sketches/;$(CADDIR)04_P/14_Sketches/;$(CADDIR)06_G/14_Sketches/;$(CADDIR)07_Y/14_Sketches/;$(CADDIR)08_A/14_Sketches/

MS_RFDIR > $(CADDIR_SUP)05_S/01_Drgs/;$(CADDIR_SUP)00_RW/01_Drgs/;$(CADDIR_SUP)01_C/01_Drgs/;$(CADDIR_SUP)02_E/01_Drgs/;$(CADDIR_SUP)03_M/01_Drgs/;$(CADDIR_SUP)04_P/01_Drgs/;$(CADDIR_SUP)06_G/01_Drgs/;$(CADDIR_SUP)07_Y/01_Drgs/;$(CADDIR_SUP)08_A/01_Drgs/
MS_RFDIR > $(CADDIR_SUP)05_S/14_Sketches/;$(CADDIR_SUP)00_RW/14_Sketches/;$(CADDIR_SUP)01_C/14_Sketches/;$(CADDIR_SUP)02_E/14_Sketches/;$(CADDIR_SUP)03_M/14_Sketches/;$(CADDIR_SUP)04_P/14_Sketches/;$(CADDIR_SUP)06_G/14_Sketches/;$(CADDIR_SUP)07_Y/14_Sketches/;$(CADDIR_SUP)08_A/14_Sketches/

MS_AUTO_VIEW_SETUP = 0

%endif

It seems like a lot, but a little effort up front and going through the process will save you a lot of hassles down the track. As always, if there is anything you want me to go through, please drop me a line.

More soon.