For a given Alignment object in AutoCAD Civil 3D, we want to find out the all the 'Station' values and the corresponding 'Design Speed' as shown in the screenshot below -
We can access these values using DesignSpeed class in Civil 3D .NET API.
Here is a relevant code snippet in C# -
Alignment objAlignment = trans.GetObject(alignmentId, OpenMode.ForRead) as Alignment;
foreach (DesignSpeed objDS in objAlignment.DesignSpeeds)
{
ed.WriteMessage("\n\tDesign Speed Number :{0} -- Start Station: {1} --- Design Speed Value :{2}",
objDS.SpeedNumber.ToString(), objDS.Station.ToString(), objDS.Value.ToString() );
}
Hope this is useful to you!