Connecting Pipes via Fittings

Hi,

I’m attempting to write a script that connects pipes.

Here is an example of what I need

On the right there are pipes that have been drawn, they are unconnected.

On the Left, the pipes are connected by (Left to right)
Elbow Bend
T- Junction
Cross Junction

Those 3 fittings are the only ones I need.

I need a script that will connect these pipes in the correct way.

Referring to: MEP Connection

I can connect pipes in elbows however this doesn’t work for the other 2 fittings.

Any ideas on how to identify those what fitting is required at each pipe interception and also how to place it?

1 Like

these nodes are in MEPover.

A node for a cross is not impossible, but it’s a lot of work if it needs to be created from 2 pipes.

5 Likes

Thanks for the help, I didnt notice the TEE node.

I could split the pipe on the interception point so it would be 4 pipes. Would that be easier?

That would surely be easier, but I kind of fail to see in what kind of situation this would be useful (faster than just using the Revit interface that is). Would love to see a proper application of this node :slight_smile:

Create New CrossFitting.dyn (5.3 KB)

7 Likes

I Think I can make it work… Thanks!

The reason for this script is transfering DWG lines to Revit Pipes to be used in projects.

I managed to write a script that brings the pipes however they are not joint up.

This is me trying to join them up xD

So what I need to do now is filter out the pipes so that when they join they have the correct fitting

That makes sense. I hope the nodes are useful, good luck!

1 Like

Thanks for the help!

let me know if you have any insight on how to filter out these pipes to have the correct fitting. As of right now, I’m finding it quite a challenge.

I can imagine. Maybe sort all the pipes (or their endpoints) by location. Then for every point in the sorted list check if the next points are within a certain margin (meaning they must belong together) and then connect those. Of course this can be really error prone if you can’t get the margin right.

1 Like

Hey T_Pover, hope its all going well.

The use of the node you provided work well. I have come round to do a cable tray script that requires to connect them up with a cross and what sad to see that your python node above doesn’t work for that.

I look at the Revit API you used and couldnt find any reference to pipes or to a cable tray equivalent. I was wondering if you had any ideas?

For Reference:

http://www.revitapidocs.com/2017.1/f8175e3f-31d3-7342-054c-4911a239531d.htm

Thanks

Joe