Convert closed curve to straight line

@Helvetosaur last piece of the puzzle was to figure out how to handle the scripts. Found the answers for that in this post of yours. Thanks.

Still working on it but this is pretty much doing what I want now. Thanks again.

    import rhinoscriptsyntax as rs
    
    object = rs.GetObject("Select a curve")
    if rs.IsCurve(object):
     length = rs.CurveLength(object)
    
     # create variable to orient the crv from the middle
     middle = length/2
    
     # prompt for distance above or below original curve
     gap = rs.GetInteger("distance above/below", 0)
    
     # orient curve for different views
     viewName = rs.CurrentView( return_name=True )
     if viewName in ("Left","Right"):
      rs.AddLine((0,-middle,gap),(0,middle,gap))
     elif viewName in ("Top","Bottom"):
      rs.AddLine((-middle,gap,0),(middle,gap,0))
     else:
      rs.AddLine((-middle,0,gap),(middle,0,gap))
1 Like