RhinoPython Add.Polyline() crashes Rhino Mac

I was playing around with RhinoPython for the first time and tried the script on this McNeel documentation page and it consistently crashes Rhino 6 Mac.

Even trying to run a simpler version such as the following consistently crashes Rhino.

import rhinoscriptsyntax as rs

polyline = rs.GetPolyline()
if polyline: rs.AddPolyline()

Since I’m completely new to using Python on Rhino I’m not sure if I’m the problem.

Hi,

You need to pass a list of points (or guids) to rs.AddPolyline().

import rhinoscriptsyntax as rs

points = rs.GetPoints(True)
if points: 
    rs.AddPolyline(points)

Does this solve the issue?

Thank you,

This also causes rhino to crash…

I know I forgot to pass the value of polyline to the AddPolyline() method, but I just ran the same code on windows and it trows and error when I reach that line, as it should. In Rhino Mac it never reaches line 4. GetPolyline() is a UI method so the user should get prompted for points before line 4 is executed and it never does.

Just to make things clear: This also always causes rhino mac to crash:

import rhinoscriptsyntax as rs

polyline = rs.GetPolyline()
if polyline: rs.AddPoint(polyline[0])

You’re absolutely right! I’ve tried the code snippet in the latest version of Rhino 6 and 7, and both times the application crashed immediately. Seems like you found quite the bug here! :slight_smile:

@dan, do you mind taking a look?

Hi -

Put on the list as RH-62329.
Thanks for reporting.
-wim