Art*_*ani 1 c# methods arguments rhino3d
我试图使用DivideByLength基于RhinoCommon SDK的下面的方法,但我无法理解第三个参数是什么.我试图基于此方法编写下面的代码但我收到以下错误消息:Error: 'Rhino.Geometry.Point3d' is a 'type' but is used like a 'variable'
我认为第三个参数是指定我想要点作为输出而不是双倍.我究竟做错了什么?
方法:
Public Function DivideByLength ( _
segmentLength As Double, _
includeStart As Boolean, _
<OutAttribute> ByRef points As Point3d() _
) As Double()
Run Code Online (Sandbox Code Playgroud)
码:
List<Point3d> pts = new List<Point3d>();
for(int i = 0; i < crv.Count;i = i + 2)
{
pts.Add(crv[i].DivideByLength(nb, true, out Point3d()));
}
Run Code Online (Sandbox Code Playgroud)
看起来这就是你要找的东西:
List<Point3d[]> pts = new List<Point3d[]>();
for(int i = 0; i < crv.Count;i = i + 2)
{
Point3d[] pointArray;
crv[i].DivideByLength(nb, true, out pointArray);
pts.Add(pointArray);
}
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅out参数文档.