# Split the lines by points

**URL:** <https://forum.dynamobim.com/t/split-the-lines-by-points/111986>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [August 19, 2025, 7:13am UTC](https://forum.dynamobim.com/t/split-the-lines-by-points/111986 "2025-08-19T07:13:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ka-wai.liu9ECQM](https://avatars.discourse-cdn.com/v4/letter/k/f05b48/32.png) [@ka-wai.liu9ECQM](https://forum.dynamobim.com/u/ka-wai.liu9ECQM)\
**Post date:** [August 19, 2025, 7:13am UTC](https://forum.dynamobim.com/t/split-the-lines-by-points/111986/1 "2025-08-19T07:13:08Z")

</div>

Hi,

I am trying to split the lines with a list of intersected points and then remove the lines between the points. My idea is to create a list of lines with intersected points and then compare two lists of lines and filter out the overlapping lines. But I have no idea how to check if it overlaps or not. Could you give me some idea, or another way to filter out the lines? thanks.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/5/f5d5da52512f237c5246589c0f060b2483de9bb5.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/f/ff1a3d44c830b73a2dcb38e38cba10633c8a1fd3.png)

Thanks,

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [August 19, 2025, 8:00am UTC](https://forum.dynamobim.com/t/split-the-lines-by-points/111986/2 "2025-08-19T08:00:29Z")

</div>

Chop the point list into pairs → transpose → line by 2 points

 ![chunking_lines](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/4/44f34e22f3bb245fe33f0023b035576ef0941a0a.png)  
 ![chunking_lines_bg](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/e/8e6fb111a290829ba74496fe85519cfdc0e99154.png)

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [September 8, 2025, 3:34am UTC](https://forum.dynamobim.com/t/split-the-lines-by-points/111986/3 "2025-09-08T03:34:11Z")

</div>

And a python option for you to try 🙂

```auto
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

line = IN[0] # Single line
points = IN[1] # Flat list of points

# Create line segments from subsequent points plus remainders
if len(points) == 0:
    OUT = [line] # No points, return original line
else:
    # Sort points by their parameter along the line
    def get_parameter(point):
        return line.ParameterAtPoint(point)
    
    sorted_points = sorted(points, key=get_parameter)
    
    line_segments = []
    
    # Add segment from line start to first point (if needed)
    first_param = get_parameter(sorted_points[0])
    if first_param > 0:
        start_segment = Line.ByStartPointEndPoint(line.StartPoint, sorted_points[0])
        line_segments.append(start_segment)
    
    # Add segments between consecutive points
    for i in range(len(sorted_points) - 1):
        segment = Line.ByStartPointEndPoint(sorted_points[i], sorted_points[i + 1])
        line_segments.append(segment)
    
    # Add segment from last point to line end (if needed)
    last_param = get_parameter(sorted_points[-1])
    if last_param < 1:
        end_segment = Line.ByStartPointEndPoint(sorted_points[-1], line.EndPoint)
        line_segments.append(end_segment)
    
    OUT = line_segments

```

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/b/cb3d2d929d755b52eaade72a7e8bf41c6338d045.png)
