Curve On Surface with rebuild (how to solve preview interruption?)[solved]

@Gijs,

Not sure why redraw stops when the mouse is still over the last picked point, but for some strange reason Rhino or IronPython often does not properly print out exeptions which happened in a delegate. I therefore suggest to put the complete content in the drawMyCurve(sender, e) function in a try / except block like this:

def drawMyCurve(sender, e):
    try:
        points[-1] = e.CurrentPoint
        curve = rhsrf.InterpolatedCurveOnSurface(points,0.01)
        e.Display.DrawCurve(curve, Color.LightCyan,2)
    except Exception as ex: 
        template = "An exception of type {0} occured. Arguments:\n{1!r}"
        message = template.format(type(ex).__name__, ex.args)
        print message
        return 

so you can see that sometimes, the interpolated curve is not created. I guess this might be the case when the e.CurrentPoint has been added to as last point and the same location is still active.

I´ve also been able to reproduce a crash with this script which you reported in this thread. After i´ve removed this line from the loop:

gp.DynamicDraw+=drawMyCurve

and put it below the line where you add the option integer just above the first getPoint(), i´ve not been able to crash it. I guess if the delegate gets added with every loop, it might have caused an overflow.

c.