Create polyline from lines

Hi, I am trying to join the lines(line1, line2, line3) from the list of lines from this image. First how to identify those 3 lines from list of lines.

Hi @balastarry it can be done many ways here is one…

Revit_navC0OswKy

Undoubtedly there is a reason you are trying to join the lines, so try to build a script that starts with that logic.

If you are trying to randomly join lines with no bases, no amount of computer brain power will be able to help you.

@pyXam I tried to build my script in this method.
By using curve.Extend start and Curve.Extend end node. I am extending the line from both ends so that it will intersect with other line. With that I can get those three lines but the issue is it will intersect with 4th line(mentioned in the image) also. Basically, I am trying this one for placing hangers, these lines are pipe & that 4th line is separate pipe routing.

@sovitek There is no issue while selecting manually. I am trying to identify and join from list of lines.

allright, then you have to share your rvt with that situation, then i think we can find a solution …thanks

MEP test file.rvt (6.2 MB)
FYI, I am preparing the script for placing hangers.

thanks allright it will depends a lot of the situation,but something here could work in your example… here i select the fittings, but could be done with select the pipes aswell…or with the location curves

or