How to access link attributes for reverse direction inside a NETWORK Program?


Product(s):Cube
Version(s):6.1 to 6.5
Area:Network

The following NETWORK script has one network file as input. The script compares the travel times between opposite directions of a two-way link and prints out the difference in travel time for that link segment.

Solution

The script achieves this by reading the same input file (HWAY.0001.NET) twice (FILEI LINKI[1] & FILEI LINKI[2]). In the INPUT PHASE, the A & B node values for FILEI LINKI[2] are switched. At the end of the input phase, the program will have 2 sets of link records. The first set of link records from FILEI LINKI[1] has the link attributes for the corresponding direction. The other set of link records has the link attributes for the reverse direction.

In the LINKMERGE PHASE, the reverse link attributes are accessed by using Li.2. Any link attribute accessed from Li.2 for a link (A, B) will have the value for the reverse direction because the original A and B nodes are switched in Li.2. In addition, the MERGE RECORD option has to be set to false so that the two sets of records are not merged.

Script (click to enlarge):

Application Process (click to enlarge):

Output File (click to enlarge):

communities.bentley.com/.../02_5F00_Example_5F00_Network.zip