RhinoPython rs.IsPolyline raises an exception


I think rs.IsPolyline does not work the way it should. The following code chunk will stop with an error if you select a point or anything but a polyline. I’d expect that it should finish gracefully with res=False.

import rhinoscriptsyntax as rs
guid = rs.GetObject("select point")
res = rs.IsPolyline(guid)

If you agree the fix would be simple: In curve.py, line 3165 the last argument should be converted from True to False and then read:
curve = rhutil.coercecurve(object_id, segment_index, False)

I’m running Rhino for Windows Version 6 SR17 (6.17.19235.15041, 23/08/2019)

Best regards,

Yeah, how the different Is...() functions are written a bit of a mish-mash, most have True arguments in rs.coerce... which force an exception to be raised if the object type isn’t correct - but a few don’t…

Those that don’t (as far as I can tell from the code):

Probably a few more…

I agree. I added a bug report.
Thanks for reporting.