The Boreholes|Auto-Assign Horizons command can be used to automatically assign horizon IDs to borehole contacts. This can save considerable time over manual assignment, although the algorithm for automatic assignment can take a considerable amount of time itself.
If you will be connecting boreholes with borehole cross sections, it is recommended that the Boreholes|Auto-Assign Horizons command be used after blank cross sections have been created, but before the cross sections have been filled. That way the algorithm for assigning the horizon IDs can use the connectivity of the boreholes as defined by the cross sections to help determine the relationship between the boreholes, but is not overconstrained by the cross section definitions.
The commands in the Boreholes menu have been listed in the order that is recommended they be used, to help you remember:
1. Auto-Create
Blank Cross Sections
2. Auto-Assign Horizons
3. Auto-Fill
Blank Cross Sections
If the Boreholes|Auto-Assign Horizons command is used after cross sections have been filled, it may fail due to the situation illustrated below. The algorithm honors the connectivity between the boreholes as defined by the cross sections, but in this case, the connectivity is invalid. In Figure 1 below, the yellow material is above the brown material on Hole 1, but below it on Hole 2. The horizon IDs represent the order in which the materials were deposited geologically, so there is no way to assign horizon IDs in this case. Hole 3 is part of the problem. The brown material on the bottom of Hole 1 and on the top of Hole 2 is the same material because of the way it is connected through Hole 3. Having a loop with a material both above and below the same material is the problem.
In a real scenario, with more materials and more complex connections, the loop may involve more than 3 holes and may be difficult to find. However, the GMS error message should list one of the holes in the invalid loop.
Figure 1

There are a number of ways to correct the problem described above. The first way is to prevent the problem by using the Auto-Assign Horizons command before you have filled cross sections, as mentioned above. If that is not possible, one way to fix the problem is to break the loop by removing one of the cross sections. Another way is to redefine one of the cross sections in the loop, as illustrated in Figure 2 below. In Figure 2, the cross section connecting holes 2 and 3 has been redefined such that now there are 2 brown material horizons, an upper and a lower, with the yellow material in between. GMS can automatically assign horizon IDs in this case.
Figure 2
