How can I get decimal places to persist in my annotations in WaterGEMS for ArcMap?

  Applies To 
  Product(s):
Bentley WaterGEMS, Bentley SewerGEMS, Bentley HAMMER
  Version(s): 08.11.XX.XX
  Original Author: Mark Pachlhofer, Bentley Technical Support Group

Problem

How can I get decimal places to persist in my annotations in WaterGEMS for ArcMap?

Solution

This solution assumes that you are adding a field to the pipe Geotable, but will work for an element table or property that you are trying to annotate. 

1) Start an ArcMap Edit session

2) Go to View > Flextables and then open the pipe geotable and add in the "Length (User Defined)" if you are using that or add the regular length (scaled) field if you're using it. This is where you'd also add whatever other fields you wanted to annotation or color code. After doing that your field(s) are added to the flextable and the properties of the layer it's associated with.

3) Right click on the pipe layer and go to "Properties". Click on the Labels tab and click the "Expression..." button.

Make sure the parser for the expression is set to VBScript and enter this in the dialog box above the parser setting:

FormatNumber([Length_User_Defined] ,2) & "m"   the "[Length_User_Defined]" field can be replaced by any field you like, such as flow or diameter. Just make sure to double click it from the fields like above expression to add it in. The number after the comma in the expression is the number of decimal places that you want to be displayed. Finally, the & "m" adds whatever string is in the quotation marks  to the end of the expression. 

Another way to accomplish the same task is to remove the comma's before the thousands place and use a Python parser with the expression:

str(round(float([Length_User_Defined]), 2)) + "m"   

4) Now Save the MXD file and save the WaterGEMS file. Saving the WaterGEMS file is done from the Project Manager window (View > Project Manager > Click the disk icon). Finally, close ArcMap.

5) Open ArcMap up again and follow these directions to load the project. Open the MXD file. Go to View > Project Manager and click the second icon to open the project file. It’s a folder with a red arrow on it to indicate opening a project. Once the project is reloaded the labels should show up as they were before. 

Recommended
Related