Dear Eric,
Yes, indeed, the slope is read-only.
This is necessarily so, because changing the pipe slope will affect neighbouring connected pipes and the entire system, so you cannot just modify the parameter value to achieve that.
Here is a sequence of samples that explores several different ways to modify pipe start and end points and thus their slope:
http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html
Cheers
Jeremy
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.
Dear Eric,
Happy New Year to you again, now through this public channel!
Thank you for confirming that the issue still persists, and for your patience.
I discussed with the development team, and they confirm that it looks like an issue that needs rectifying.
Accordingly, we filed a development database entry for it, REVIT-106354 [pipe slope does not update when modify the pipe curve location by api]. Please make a note of this number for future reference.
You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.
This issue is important to me. What can I do to help?
This issue needs to be assessed by our engineering team, and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:
This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.
Cheers
Jeremy
Workaround until fixed: recreate the pipe, as described in
http://forums.autodesk.com/t5/revit-api-forum/pipe-slope-not-updating/m-p/6781872
Cheers,
Jeremy