Returns the degree of a curve object.
rhinscriptsyntax.CurveDegree (curve_id, segment_index=-1)
rhinscript.curve.CurveDegree (curve_id, segment_index=-1)
curve_id |
Required. String or Guid. The object's identifier. |
segment_index |
Optional. Number. If curve_id identifies a polycurve object, then segment_index identifies the curve segment of the polycurve to query. |
Number |
The degree of the curve if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a curve")
if rs.IsCurve(obj):
degree = rs.CurveDegree(obj)
print "Curve degree:", degree