Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing a Pipe's Slope?

4 REPLIES 4
Reply
Message 1 of 5
truevis
1860 Views, 4 Replies

Changing a Pipe's Slope?

When a pipe is selected and is "element":
 
  element.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(0.55);
 
works, but
 
 element.get_Parameter(BuiltInParameter.RBS_PIPE_SLOPE).Set(0);
 
gets an error that it's read-only. 
 
Programmatically changing the endpoints of a Pipe does not update its Slope parameter. Anyone know how to set a Pipe's Slope parameter?
 
PS: The journal entry says "ID_RBS_EDIT_SLOPE" when I do it though Revit's UI.
Tags (1)
4 REPLIES 4
Message 2 of 5
jeremytammik
in reply to: truevis

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5
truevis
in reply to: jeremytammik

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
Screen Shot 10-01-15 at 10.20 PM.PNG

after
Screen Shot 10-01-15 at 10.27 PM.PNG

You can see it is horizontal but Slope parameter still shows non-zero.Screen Shot 10-01-15 at 10.27 PM 001.PNG

Manually setting its slope to 0 fixes how it's displayed.

Screen Shot 10-01-15 at 10.28 PM.PNG

 

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.

Tags (1)
Message 4 of 5
jeremytammik
in reply to: truevis

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:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 5
jeremytammik
in reply to: jeremytammik

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community