Extend curve in python

Hi All,
I am facing a problem while using the rs.ExtendCurve function in python, as you see in the attached photo, I try to choose the line and the circle to which I want the line to be extended, but it gives me this error !: iteration over non-sequence of type Guid.
I hope if you can kindly help me with this.
Best ragards

You need to use rs.GetObjects for boundry objects:

import rhinoscriptsyntax as rs
line = rs.GetObject("Select line to extend", rs.filter.curve)
circle = rs.GetObjects("Select boundary circle", rs.filter.curve)
rs.ExtendCurve(line,0,1, circle)

Or:

import rhinoscriptsyntax as rs
line = rs.GetObject("Select line to extend", rs.filter.curve)
circle = rs.GetObject("Select boundary circle", rs.filter.curve)
rs.ExtendCurve(line,0,1, [circle])
1 Like

Hello Mahdiyar,
Thanks very much for your reply. is the (rs.filter.curve) obligatory to input my curves ? The problem is in my actual task I get my line and my circle from two different lists and it gives me the same message: iteration over non-sequence of type Guid. [Heidi.py|attachment]

(upload://ht4yn9CfmjKD1rqAUdEiAphXVyn.py) (1.0 KB)

Try this:

extended_line = rs.ExtendCurve(line, 0, 1, [circles[index]])
1 Like

Thanks so much, sorry that I didn’t get it early !