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: 

Set the correct inner and outer diameter for pipes and conduits

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
nicolaadn
381 Views, 2 Replies

Set the correct inner and outer diameter for pipes and conduits

Hello everybody.
The question is simple, but no one seems to know the answer.
I've tried several ways, the simplest and most linear is to use the relative parameter.

 

pipe.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(0.050 * 3.28084); // 50mm


However, in this way the internal and external diameter do not correspond to the correct MEPSize of the related PipeSegment.
How can I set the diameter of a pipe as in Revit UI?

Tags (3)
2 REPLIES 2
Message 2 of 3
RPTHOMAS108
in reply to: nicolaadn

Probably the size has to exist in the segment used to be selected.

When you change that outside diameter parameter it should pick the nearest size match in the list of sizes for that segment. Perhaps with the API it just adds the size to the segment with no thickness set (check what is defined in the segment sizes).

 

You can change sizes for segment via.

 

Pipe.PipeSegment

PipeSegment.AddSize
PipeSegment.RemoveSize

PipeSegment,GetSizes

 

So perhaps add the size to segment first (OD and ID) then change the outside diameter on the Pipe instance as you originally did above.

Message 3 of 3
nicolaadn
in reply to: RPTHOMAS108

Thanks for reply. I made some attempts
I found the definitive solution: I have to use a better approximation from millimeters to feet, or directly the NominalDiameter field of MEPSize.

 

pipe.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(0.050 * 3.280839896); // 50 mm

or

PipeSegment pipeSegment = ...;
MEPSize size = ...;
pipe.get_Parameter(BuiltInParameter.RBS_PIPE_SEGMENT_PARAM).Set(pipeSegment.Id);
pipe.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(size.NominalDiameter);
                        

 

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

Post to forums  

Rail Community


Autodesk Design & Make Report