Code String Rules¶
The CodeStringRules file is a plain text file that controls how survey points are grouped into strings. It answers the question: "For a given code, which attribute values should be used to separate points into distinct strings?"
Strings are drawn as lines, polylines, or 3D polylines depending on the String Style configuration for that code.
The file is located at:
%APPDATA%\SpatialViz\CodeStringRules\<ConfigName>_CodeStringRules.txt
Open it from R3MANAGECONFIGS → Edit Code String Rules.
Basic format¶
Each rule is one line:
CODE = A1
This means: group all points with code CODE by their A1 value. Points with the same A1 value are joined into one string; points with different A1 values are separate strings.
Multiple attributes¶
CODE = A1, A3
Points are grouped by the combination of A1 and A3. Two points with the same A1 but different A3 form separate strings.
String by code only (no attribute separation)¶
CODE =
All points with this code are joined into a single string, regardless of attributes. Use this for codes where only one string ever exists per job.
Comments¶
Lines beginning with # are comments and are ignored.
Worked example¶
Suppose you have kerb points coded KERB, where the codelist defines:
- A1 as the string identifier (1, 2, 3 …)
- A3 as the position (Top, Bottom)
With the rule KERB = A1, A3:
| Point | Code | A1 | A3 | String ID |
|---|---|---|---|---|
| 1 | KERB | 1 | Top | KERB-1-Top |
| 2 | KERB | 1 | Top | KERB-1-Top |
| 3 | KERB | 1 | Bottom | KERB-1-Bottom |
| 4 | KERB | 2 | Top | KERB-2-Top |
Points 1 and 2 join together. Points 3 and 4 each form separate strings.
Conditional rules¶
Use IncludeIf to only string a code when a specific attribute condition is met:
DO.IncludeIf A3 = Corner : A1
This means: only include DO points in strings where A3 = Corner; when included, group them by A1. Points with any other A3 value are not strung (they may still be drawn as individual points).
Multiple conditions (AND)¶
DO.IncludeIf A3 = Edge only & A2 = Side : A1
Both conditions must be true: A3 = Edge only and A2 = Side. If either condition fails, the point is not strung.
Multiple conditional rules for the same code¶
You can have several IncludeIf rules for the same code:
DO.IncludeIf A3 = Corner : A1
DO.IncludeIf A3 = Edge only & A2 = Side : A1
Each rule is evaluated independently. A point matching the first condition joins one group of strings; a point matching the second joins a different group.
Full format reference¶
# Basic rules
ACON = A1 # string ACON points by A1
BANK = A1, A2 # string BANK points by A1+A2 combination
ALIGN = # string all ALIGN points together
# Conditional rules
CODE.IncludeIf ATTR = VALUE : GROUPBY
CODE.IncludeIf ATTR1 = VALUE1 & ATTR2 = VALUE2 : GROUPBY
Tips¶
- Order doesn't matter for basic rules, but
IncludeIfrules are evaluated in file order — list more specific conditions before general fallbacks - Codes not listed in the rules file are still drawn as points; they just won't have connecting linework
- Attribute values in conditions are case-insensitive (
Corner=corner) - A code can have both a basic rule and
IncludeIfrules — theIncludeIfconditions take priority for matching points; the basic rule handles the rest
Real example (from MLS_v14 configuration)¶
# String kerb points by A1 (string identifier) and A3 (position)
KERB = A1, A3
# String buildings by A1 (string identifier) and A5 (floor level)
BLD = A1, A5
# String drainage channels by A1 only
CHNL = A1
# Include door openings only when A3 = Corner; group by A1
DO.IncludeIf A3 = Corner : A1
# Include door openings when A3 = Edge only AND A2 = Side; group by A1
DO.IncludeIf A3 = Edge only & A2 = Side : A1