I am using ArcGIS Pro.
I want to draw a line at the starting and ending of elevation, and then use straight line interpolation to assign the rest of the line an elevation.
To achieve this you need 3D Analyst and also elevation model:
arcpy.InterpolateShape_3d("DEM", "ROADS", "in_memory/road_3d")
arcpy.AddGeometryAttributes_management("road_3d", "LINE_START_MID_END")
arcpy.FeatureTo3DByAttribute_3d("road_3d", "in_memory/LINEAR_3D", "START_Z", "END_Z")
So for the road shown:
it will result in:
Note: If you know elevations at line ends, you'll need just one tool, that is feature to 3d by attribute(s).
This is actually a very primitive way of 'DEM burning' used by many applications.