Its far more complicated than that.
We were asked by a state DOT to merge all their CL alignments into single alignments while maintaining the original stationing and direction. In order to do this we needed to find all the alignments that had common end points or overlapping segments and merge them together to create extremely long alignments. Because each original alignment was surveyed at a different point in time and had different starting stations and directions it required us to create a station equation at each point where they were merged.
In one example there were 38 original alignments that were merged, resulting in a single alignment 50 miles long with 37 station equations with most station equations increasing and some station equations decreasing. As you can imagine, due to the number of station equations, there will be many duplicate stations along the alignment
Fortunately, I was able to develop a robust tool set using the .NET API to automate this process which was a great time saver.
Now comes the next phase where we need to develop a tool that allows a user to enter in a station/offset to find that location along the alignment and perform some additional work. Because the station could exist at numerous locations along the alignment (due to station equations) I need a function to return all the possible positions along the alignment for that station so that I can display them to the user from which they can choose the correct location.
Here's the rub, I know that this functionality exists in Civil 3D. Just run the command to location point at station/offset along an alignment and a dialog is displayed if more than one exists (see attached).
I was hoping that I wouldn't have to write this functionality but in retrospect it was very easy.
It works something like this....
1. Loop through all station equations and examine each pair of consecutive station equations.
2. If station equation 1 is ascending, determine if the specified station is after the station ahead of equation 1 and before the station back of equation 2.
3. If station equation 1 is descending, determine if the specified station is before the station ahead of equation 1 and after the station back of equation 2.
4. If 2 or 3 is true, get the absolute difference between the specified station and station ahead of equation 1 and add this to the raw station back of equation 1 to get the raw station of the specified location.
Mike Szanto | Applications Developer
mszanto@microdesk.com