WaterGEMs XML Guide


This guide is aimed at advanced users.  However, knowing how to work with WaterGems XML files can save you a lot of time in some situations.

Before editing a WaterGems XML file, it is recommended that a backup of the original unedited version be kept.  Whilst not fatal, if a user misedits an XML, much time can be lost.

If a user inadvertantly finds that edits have created application or model errors, and no back-ups available, deleting the XML file entirely will generally trigger WaterGems to create a new XML file in its place with default WaterGems settings.

XML Files

XML files are text files, and can be edited with any text editor, but they suffer from not being very human readable.  Use of a good XML Editor is recommended, such as XMLMind.  This makes it easier to browse XML file content, and allows copy and pasting of entire XML blocks within the same file, or between files.

Example WaterGems XML Files

As an example, some more common WaterGemx XML Files are: 

1.  *.wtg Files.  Despite the file extension, they are XML files. These contain a lot of information, but no modeling "data".  These can be deleted with no harm to the model, however they contain all of the project metadata,  element display and symbology settings for the project, custom Project settings in the Options->Project Tab etc. etc.

Some of the key elements that can be copy and pasted from these files into other WaterGems projects are:

a. Symbology/Color Coding/Layer options.  These are often very time-consuming to duplicate across WaterGems projects.  XML copy and replace pasting can reuse previous project Element Symbology into other pojrects.

b. Query Selection Definitions

Each of these are in their own self-contained "block". You can copy and paste these on top of the corresponding blocks in other *.wtg files reasonably safely, but beware in that the wtg format can change between WaterGems versions (so can other WaterGems XML files, but generally they change less). Eg. If you copy a pre Build 08.09.400.34 block into a later WaterGems model file, expect to get errors!

2. ModelBuilder Definitions. C:\Documents and Settings\{Profile Name}\Application Data\Bentley\WaterGEMS\8\ModelBuilder.xml

Not matter what you do, your ModelBuilder list invariably ends up in a real mess, with 50 entries before you realise it that you just can't remember what they did, nor in the neat order that you would like. Another downside it is local to that PC only. Go to another PC (or you replace your PC), and you have to redefine your ModelBuilder definitions all over again.

Each ModelBuilder definition is self-contained in its own block, so it is relatively easy to copy/paste (into another XML file) or drag/drop these (within the same XML file). I generally keep a ModelBuilder.xml library of definitions on the network that I can go and retrieve from if I want if I need to move to another user's PC and need to do some ModelBuilder operations. I can then just drag and drop the definitions I need into the local ModelBuilder.xml file.

  • Created by Communities MVP
  • When: Wed, Jul 16 2008 3:33 AM
  • Last revision by Bentley Colleague Communities MVP
  • When: Thu, May 9 2013 8:49 AM
  • Revisions: 2
  • Comments: 0