@saeed_hasan_zadeh Thank you very much!
This is a solution.
But I still like to solve this problem with the flow of my logic. Because I believe this problem can be solved with GH data structure manipulation. This kind of grouping-regrouping-grouping problem puzzles me quite long time.

your heavy line like the new 3500-line is not working with Line Topology component in your own logic and your script need to be corrected, you may test it yourself but there is no problem with prep edges:

@saeed_hasan_zadeh nice method to find parallel lines! the problem is that some nodes has 2 parallel lines by usind DotProduct you can adjust to find only the line with the opposite direction, now work fine with the 3k lines and @Quan_Li rotation. How can I pair the lines_003.gh (267.2 KB)