分享一段VB的, 是 Rajaa 在 PanelingTools 中分享的原代码
- Call Main()
- Sub Main()
-
- Dim arrCrvObject, strSrfObject, arrPanels, PTObj
- Const intMethod = 0 'Method = 0=all, 1=subs only, 2=mains only
- Const intDegree = 4 'Degree = Levels of sub paneling
- Const bPull = true 'Pull panels to surface
-
- On Error Resume Next
- 'Get PanelingTools Object
- Set PTObj = Rhino.GetPluginObject("PanelingTools")
- If Err Then
- MsgBox Err.Description
- Exit Sub
- End If
-
- 'Select a surface
- strSrfObject = Rhino.GetObject("Select a surface",8)
- If Rhino.IsSurface(strSrfObject) Then
- 'Get any number of polylines to Sub Panel surface with
- arrCrvObject = Rhino.GetObjects("Select polylines",4)
- If IsArray(arrCrvObject) Then
- 'Call Sub Paneling Method
- arrPanels = PTObj.SubPaneling( strSrfObject, arrCrvObject, intMethod, intDegree, bPull )
- End If
- End If
- Set PTObj = Nothing
- End Sub
复制代码 |