Thanks for the CmdRollingOffset code. I do not see where an existing Slope paramter is changed, though. I will re-state the problem with an example:
Pipe Slope can be changed with the UI. If a pipe has a slope but its endpoints are changed with the API, the Slope parameter is not updated, so when the pipe is selected, the wrong end elevations and slope are displayed. If the pipe has been programmatically made horizontal (equal Z endpoints) it can be fixed by manually typing "0" into the slope input on the pipe while it's selected.
I would like to do that last step programmatically.
Example:
Take the MoveLinear API Sample and use this code where line endpoints are set. In this case equal Zs.
//get start point via "get_EndPoint(0)"
Autodesk.Revit.DB.XYZ newStart = new XYZ(
lineLoc.Curve.GetEndPoint(0).X,
lineLoc.Curve.GetEndPoint(0).Y,
lineLoc.Curve.GetEndPoint(0).Z);
//get end point via "get_EndPoint(1)"
Autodesk.Revit.DB.XYZ newEnd = new XYZ(
lineLoc.Curve.GetEndPoint(1).X,
lineLoc.Curve.GetEndPoint(1).Y,
lineLoc.Curve.GetEndPoint(0).Z);
It sets the pipe's Zs equal but the Slope parameter is not changed.
before

after

You can see it is horizontal but Slope parameter still shows non-zero.
Manually setting its slope to 0 fixes how it's displayed.

Additional findings: Cut and paste-align of the pipe will also fix the Slope display. (But that doesn't help if the pipe is connected.) Opening the RVT with Audit doesn't fix it.