By Augusto Goncalves (@augustomaia)
Since Civil 3D 2016 SP1 we have the Feature Line API available for developers. It's possible to set new elevation for points on the feature line, but it may not be that direct to do so as we need the index of the point and, if we think in delta of elevation, we need the original point elevation.
This quick extension method aims to do that, just call FeatureLine.SetPointNewElevation(somePoint, elevationDelta)
public static void SetNewPointElevation(this FeatureLine fl, Point3d point, double elevationDelta) { // get all points on the Feature Line Point3dCollection pointsOnFL = fl.GetPoints(FeatureLinePointType.AllPoints); // find the closest point and index double distance = double.MaxValue; int index= 0; Point3d closestPointOnCurve = Point3d.Origin; for (int i = 0; i < pointsOnFL.Count; i++ ) { Point3d p = pointsOnFL[i]; if (p.DistanceTo(point) < distance){ distance = p.DistanceTo(point); closestPointOnCurve = p; index = i; } } // apply the delta fl.SetPointElevation(index, closestPointOnCurve.Z + elevationDelta); }