Rs. ExtendCurve keep giving "iteration over non-sequence of type int

I am trying to find the intersection of a line extension and a brep. It keeps to give the following error message. However, after I used print(type(line)) to check, “line” is not int.

The line “extension = rs.ExtendCurve(line, 0, 1, 1)” has an error message
“Runtime error (TypeErrorException): iteration over non-sequence of type int
line 2569, in ExtendCurve, “C:\Users\\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\”
line 29, in script”

Many thanks.

The whole codes are as below.

import rhinoscriptsyntax as rs
import math

# create evenly distributed point on a sphere with a given center and a radius
def create_points_on_sphere(center, radius, num_points):
    phi = math.pi * (3 - math.sqrt(5))  # golden angle in radians
    points = []
    for i in range(num_points):
        y = 1 - (i / float(num_points - 1)) * 2  # y goes from 1 to -1
        radius_at_y = math.sqrt(1 - y * y)  # radius at y
        theta = phi * i  # golden angle increment
        x = math.cos(theta) * radius_at_y
        z = math.sin(theta) * radius_at_y
        point = [x * radius, y * radius, z * radius]
        point = rs.PointAdd(center,point)
    return points

# Create evenly distributed points on the surface of the sphere
points = create_points_on_sphere(center, radius, num_points)

# Add lines from the center of the sphere to the points on the sphere and intersection points
lines = []
intersection_points = []
for point in points:
    line = rs.AddLine(center, point)
    extension = rs.ExtendCurve(line, 0, 1, 1)
    intersection = rs.FirstIntersectingObject(extension, [brep])
    if intersection:
        lines.append(rs.AddLine(center, intersection[1]))

rs.ExtendCurve(line, 0, 1, 1)

The 4th argument is a list of GUIDs of the boundary curves to extend to, you supplied it with an integer (1)

I have changed it to “brep”. The error remains.

I have changed this line as

extension = rs.ExtendCurve(line, 0, 1, brep)

The error is as this
"Runtime error (TypeErrorException): iteration over non-sequence of type Brep

line 2569, in ExtendCurve, “C:\Users\\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\”
line 30, in script"

One post suggest that “brep” has to be list access. I revised the code as this extension = rs.ExtendCurve(line, 0, 1, brep)
and set “brep” as list access.
Then I have got this error message:
Runtime error (MissingMemberException): ‘NoneType’ object has no attribute ‘Geometry’