# CurveClosestObjects problem

Hi all,

Why do I get a:
“Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid”
in the rs.CurveClosestObjects section?

text_min = is a list of values (ex 25.5, 30, 45.3)
pts = is a list of points
srf = is a surface that intersects with pts
Values in text_min correspond to the points in pts

``````for i in text_min:
if i == min(text_min): # Finding lowest value in list
index_low.append(text_min.index(i))
else: # Adding all points in other list except the one found from index above.
pts_exept.append(pts[text_min.index(i)])
cc_pt_index.append([i,pts[text_min.index(i)],text_min.index(i)])

if len(index_low) == 1:
pt_low.append(rs.PointCoordinates(pts[index_low[0]]))
line_dir = Geometry.Line(rs.PointCoordinates(pts[index_low[0]]),directionMin[index_low[0]],100)
line_pull_r = Geometry.Curve.PullToBrepFace(Geometry.Line.ToNurbsCurve(line_dir),rs.coercesurface(srf),0.1)
line_extend = Geometry.Curve.ExtendOnSurface(line_pull_r[0],Geometry.CurveEnd.Both,rs.coercesurface(srf))

else:
print "to many in list"

print rs.CurveClosestObject(line_extend,pts_exept)
``````

I’m trying to get the point that is closest to the curve. But mayby CurveClosestObject doesn’t work with points?
there is a function in Grasshopper that does the work (curve nearest object) but I would like to stay in rhinoscriptsyntax if possible.

Any help is much appreciated!