If we refer to AutoCAD Civil 3D API reference document for SuperelevationOptions, we see most of the properties are Get as shown in the screenshot below -
If you are wondering why these are only Get and how do we set these properties using API, answer is, their values are Get and Set and we can use the appropriate property and it’s value to set as per our project requirement.
Here is an example using C# .NET API –
Default settings before we make a change using API –
Here is the code snippet –
using (Transaction trans = db.TransactionManager.StartTransaction())
{
SettingsAlignment alignmentSettings = civilDoc.Settings.GetSettings<SettingsAlignment>();
ed.WriteMessage("\nSuperelevationOptions.CorridorType Before Set :" +
alignmentSettings.SuperelevationOptions.CorridorType.Value.ToString() +
"\nSuperelevationOptions.NominalWidth Before Set :" +
alignmentSettings.SuperelevationOptions.NominalWidth.Value.ToString());
// Values are Get / Set
alignmentSettings.SuperelevationOptions.CorridorType.Value = SuperelevationCorridorType.Divided;
alignmentSettings.SuperelevationOptions.NominalWidth.Value = 8.2;
trans.Commit();
}
And changed values after we run our custom code –
Hope this helps !