# 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
Traceback:
line 2569, in ExtendCurve, “C:\Users\s.su\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py”
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
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
theta = phi * i  # golden angle increment
return points

# Create evenly distributed points on the surface of the sphere

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

``````

`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

Traceback:
line 2569, in ExtendCurve, “C:\Users\s.su\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py”
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’