我想通过 IronPython从RhinoCommonCurve.Trim(CurveEnd, Double)
API 调用该方法。我怎样才能确保我没有得到超载?Curve.Trim(Double, Double)
crv.Trim(geo.CurveEnd.End, 8.8)
#raised: Message: expected float, got CurveEnd
注意:如果您想自己尝试,您需要安装Rhino 的试用版。它包括一个 Python 编辑器。
编辑/添加:杰夫提到 的.Overloads
属性在这里也不起作用。用于测试的片段:
import rhinoscriptsyntax as rs
import Rhino.Geometry as geo
import System
# first draw a curve longer than 8.8 units
crvO = rs.GetObject() # to pick that curve on the 3d GUI screen
crv = rs.coercecurve(crvO) # to get Rhino.Geometry.Curve
# these both don't work:
crv.Trim(geo.CurveEnd.End, 8.8)
#Message: expected float, got CurveEnd
crv.Trim.Overloads[geo.CurveEnd, System.Double](geo.CurveEnd.End, 8.8)
#Message: Trim() takes at least 2147483647 arguments (2 given)