The code snippet below shows how to find the tangent direction on an alignment at a given statin/offset value. This may be useful in performing report calculations. In looking through the API documentation it may not be easily noticed since it’s hiding in the PointLocationEx method of an alignment.
Dim settingsStation As AeccLandLib.AeccSettingsStation
settingsStation = ReportApplication.AeccXDatabase.Settings.AlignmentSettings.AmbientSettings.StationSettings
Dim tolerance As Double
tolerance = Math.Pow(10, -settingsStation.Precision.Value)
Dim curStation As Double
For curStation = stationStart To stationEnd Step staIncment
Dim curNorthing As Double
Dim curEasting As Double
Dim curTangent As Double
Try
If oAlignment.PointLocationEx(curStation, 0.0, tolerance, curEasting, curNorthing, curTangent) _
= AeccLandLib.AeccAlignmentReturnValue.aeccOK Then
Dim stationString As String
stationString = oAlignment.GetStationStringWithEquations(curStation)
Dim alignData As New DirectionData
alignData.station = stationString
alignData.northing = FormatCoordSettings(curNorthing)
alignData.easting = FormatCoordSettings(curEasting)
alignData.tangentialDirection = FormatDirSettings(Math.PI / 2 - curTangent)
m_AlignDataList.Add(alignData)
End If
Catch ex As Exception
Diagnostics.Debug.Assert(False, ex.Message)
End Try
Next
The code snippet is from the Civil 3D Reports Source code that ships with the product.
No comments:
Post a Comment