We work on many school projects so run into cases like this where we have many sets of branch piping from classrooms that we need to connect back to a main in a corridor. I have the graph below working for a single set of branch to main piping. I’m basically sending a line back to the main, finding the intersection point and using that to create a new pipe and tee at that point. I would like the ability to select multiple sets at once back to the mains but when I try to combine this into one, as soon as the main breaks into two pipes (the existing and one new element at the tee) then the next connection fails. I’ve seen some topics that bring this up but haven’t found any with a fix or workaround. I tried making new mains at the intersection points but deleting the old and merging new didn’t work cleanly either. Any suggestions would be great.
This should be described in some of the other topics, but the issue you’re seeing is due to the order in which you connect your branches back to the main. If you tell the API that 3 pipes are going to be connecting back into the main, then the API is going to expect that each of those pipes intersects with the main. Before you make any connections, that would be true. But once you make a connection with the first branch, you’ll be left with the original main and the new main created at the break by the fitting. If the next branch intersects with the new main, then the API call is now invalid. The branch wouldn’t intersect the original main and therefore won’t create a connection.
I forget the order that you need to follow to make sure this happens correctly, but I think you want to order your connections on the main from end point to start point. This should mean that the remaining length of the original main is always in place for the next connection.
That was it…I sorted my branch pipe list by distance to start point of the main branch line. It didn’t work the first time but then I reversed that list and it worked so sorting and connecting nearest to end point must be the trick to keep the original main pipe element available during the connect to main with tee node. Thanks Nick!


