找回密码
 注册
搜索
查看: 28800|回复: 6

[在线求助] 在學習 rhino script 的中的一問題~

[复制链接]
发表于 2010-9-21 20:30:05 | 显示全部楼层 |阅读模式
我在讀 rhinoscript 的handout 他里面有一個script 是這樣的
Sub Main()
Dim blnResult
blnResult = DisplayCopyRightMessage("Reinier and Carl", vbTURE)
End Sub

Function DisplayCopyrightMessage(strNames, blnUseCommandLine)
Dim strMessage

strMessage = "This script was written and is copyrighted by " & _
strNames & "." & vbNewLine & _
"You are allowed to use and modify this code " & _
"provided you do not remove copyright."

If blnUseCommandLine Then
Rhino.Print strMessage
Else
Rhino.MessageBox strMessage, 64, "copyright notice"
End If

DisplayCopyRightMessage = vbTRUE
End Function


紅色的這一行 其實在起什麼作用呢~
我試下刪了它 FUNCTION 一樣可以用

求解~{:3_57:}
发表于 2010-9-21 22:06:22 | 显示全部楼层
对于这个DisplayCopyrightMessage这个function是不起作用
控制打印的是blnUseCommandLine,一开始就是true了
但是可以返回一个值,让DisplayCopyRightMessage = vbTRUE
以后可以根据DisplayCopyRightMessage的值控制其他语句
回复

使用道具 举报

 楼主| 发表于 2010-9-21 22:27:03 | 显示全部楼层
謝了 大哥~
你说可以用 DisplayCopyRightMessage 來控制其他語句 可以舉個例子嗎~?
回复

使用道具 举报

 楼主| 发表于 2010-9-27 14:11:36 | 显示全部楼层
本帖最后由 agpig 于 2010-9-27 16:24 编辑

Function AddCirclesAroundCurve(strCurveID)
Dim i, crvDomain, divDomain
Dim vecTan 'Tangent vector
Dim dblRadius

crvDomain = Rhino.CurveDomain(strCurveID) 'The domain bounds
divDomain = crvDomain(1)-crvDomain(0) 'The domain size

For i = crvDomain(0) To crvDomain(1) Step divDomain/100
vecTan = Rhino.CurveTangent(strCurveID, i)
dblRadius = Sin(i*10) + 2

Rhino.AddCircle vecTan(0), dblRadius, vecTan(1)
Next

AddCirclesAroundCurve = vbTrue
End Function
  
我想請教一下 這句 在 Function AddCirclesAroundCurve(strCurveID) 里是沒有 BLN值的但為什麼 又會 給它一個 VBTRUE 的值呢~~
回复

使用道具 举报

 楼主| 发表于 2010-9-27 16:36:43 | 显示全部楼层
1 Function PullCurveToSurface(strSurfaceID, strCurveID)
2 Dim arrCP, arrKnots, arrWeights
3 Dim intDegree, i
4 Dim arrNewPt, strNewID
56
arrCP = Rhino.CurvePoints(strCurveID)
7 arrKnots = Rhino.CurveKnots(strCurveID)
8 arrWeights = Rhino.CurveWeights(strCurveID)
9 intDegree = Rhino.CurveDegree(strCurveID)
10
11 For i = 0 To UBound(arrCP)
12 arrNewPt = Rhino.BrepClosestPoint(strSurfaceID, arrCP(i))
13 arrCP(i) = arrNewPt(0)
14 Next
15
16 strNewID = Rhino.AddNurbsCurve(arrCP, arrKnots, _
17 intDegree, arrWeights)
18 Rhino.DeleteObject strCurveID
19
20 PullCurveToSurface = strNewID
21 End Function
Line 6-9: Extract all required properties from the existing curve
Line 12: Find the closest point on the surface for every control point
Line 13: Replace the coordinates of the control point with the coordinates of the
closest point
Line 16: Create a new curve from the adjusted data
Line 20: Set the function return value to match the identifier of the new curve object

但是有時又不是 返回一個 BLN 值

我想問 什麼時候 用BLN 值   又什麼時候 用其他的呢 ~
回复

使用道具 举报

发表于 2011-4-14 14:56:55 | 显示全部楼层
汗 看不懂!!
回复

使用道具 举报

发表于 2011-12-9 00:12:43 | 显示全部楼层
哎。。。。。。。。。。。
回复

使用道具 举报

NCFZ微信公众号

手机版|小黑屋|NCF参数化建筑论坛 ( 浙ICP备2020044100号-2 ) 辽公网安备21021102000973号

GMT+8, 2026-11-23 19:31 , Processed in 0.039549 second(s), 19 queries , Gzip On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表