BUG: Python Script - rs.IsLine when a point is being tested

POSSIBLE BUG: Using Python Script. When using rs.IsLine(o) on a point object the following message is returned:

See the attached files. Run the script and select the line, arc, or curve and it runs great. Select the point and it errors on when testing it for a line object.

The immediate work around is to do an if statement and test to see if it is a point first and if it is then don’t test for a line. There are certain situations where I’m testing my selection for objects as lines only and now I have to do this band-aid and test for the point first.

Is this a BUG? If so, please fix!
RhinoScript IsX Errors.3dm (45.1 KB)
rhinoscriptisxerrors.py (952 Bytes)

Yes, this is a conceptual bug in that this line in the rs.IsLine() code:

curve = rhutil.coercecurve(object_id, segment_index, True)

will error out if the input object is anything but a curve because of the last True argument.

It should read:

curve = rhutil.coercecurve(object_id, segment_index, False)

Then there should be another line of code to detect the failure of corececurve and return False.

This is a problem with a number of other rs.IsSomeKindOfCurve() methods.