本帖最后由 qq56 于 2011-9-26 14:58 编辑
AddLine
Adds a line curve to the current model.
Syntax
Rhino.AddLine (arrStart, arrEnd)
Parameters
arrStart
Required. Array. The starting point of the line.
arrEnd
Required. Array. The ending point of the line.
Returns
String
The identifier of the new object if successful.
Null
If not successful, or on error.
Example
Dim arrStart, arrEnd
arrStart = Rhino.GetPoint("Start of line")
If IsArray(arrStart) Then
arrEnd = Rhino.GetPoint("End of line")
If IsArray(arrEnd) Then
Rhino.AddLine arrStart, arrEnd
End If
End If
以上是addline在rhino中提供的帮助,下面是小问题:
按照帮助文件里面的提示,我如下的写,运行提示错误。
Call Main()
Sub Main()
Dim arrStart, arrEnd,line1
arrStart = rhino.addpoint (array(0,0,0))
arrEnd = rhino.addpoint(array(2,2,2))
line1=rhino.AddLine(arrstart,arrend)
End Sub
如下这样写可以得到结果(将上面的赋值的点转换为坐标的形式,那addline的参数应该是坐标,而不是点才对,这和Required. Array. The starting point of the line.
的要求是矛盾的,谁能解答下,谢谢)
Call Main()
Sub Main()
Dim arrStart, arrEnd,line1
arrStart = array(0,0,0)
arrEnd = array(2,2,2)
line1=rhino.AddLine(arrstart,arrend)
End Sub |