标题:在Rhino中运行脚本提示 类型不匹配:'ubound'
只看楼主
mysweetie
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-4-27
 问题点数:0 回复次数:0 
在Rhino中运行脚本提示 类型不匹配:'ubound'



点击选择了一个点后就会提示 类型不匹配:'ubound'

以下是源代码:

option explicit
'Script by Frank

sub main()
dim arrObjects, arrCoords
dim arrAverage(2)
dim i, sumX, sumY, sumZ

arrObjects = Rhino.GetObject("Select points", 1, ,vbTrue)
if IsNull(arrObjects) then exit sub

sumX = 0
sumY = 0
sumZ = 0

for i = 0 to Ubound(arrObjects)
arrCoords = Rhino.PointCoordinates(arrObject(i))
sumX = sumX + arrCoords(0)
sumY = sumY + arrCoords(1)
sumZ = sumZ + arrCoords(2)
next

arrAverage(0) = sumX / (Ubound(arrObjects) + 1)
arrAverage(1) = sumY / (Ubound(arrObjects) + 1)
arrAverage(2) = sumZ / (Ubound(arrObjects) + 1)

Rhino.Print "Average:" & Rhino.Pt2Str(arrAverage, 3)
Rhino.AddTextDot "Centroid", arrAverage

end sub

main

搜索更多相关主题的帖子: Rhino ubound 脚本 类型 提示 
2007-04-27 18:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-135461-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.194529 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved