找回密码
 注册
搜索
查看: 10901|回复: 1

[GH插件] grasshopper中的vb编程问题求助

[复制链接]
发表于 2022-10-18 10:44:13 | 显示全部楼层 |阅读模式
本帖最后由 clearlove33 于 2022-10-18 10:45 编辑

出现未声明onutil,可能因其保护级别而不可访问的错误
Private Sub RunScript(ByVal PenroseString As String, ByVal Length As Double, ByRef PenroseLines As Object)
    Dim Pt As New Point3d(0.0, 0.0, 0.0)

    Dim arrPoints As New List( Of Point3d )

    Dim V As New Vector3d(1.0, 0.0, 0.0)

    Dim PtStack As New List( Of Point3d )
    Dim VStack As New List( Of Vector3d )

    Dim count As Integer = PenroseString.Length
    Dim i As Integer
    Dim Rule As Char

    For i = 0 To count - 1
      Rule = PenroseString(i)

      If Rule = "+" Then
        V.Rotate(OnUtil.On_DEGREES_TO_RADIANS * (+36.0), OnUtil.On_zaxis)
      End If

      If Rule = "-" Then
        V.Rotate(OnUtil.On_DEGREES_TO_RADIANS * (-36.0), OnUtil.On_zaxis)
      End If(error(BC30451)未声明onutil,可能因其保护级别而不可访问)

      If Rule = "1" Then
        Dim newPt1 As New Point3d(Pt)
        arrPoints.Add(newPt1)

        Dim newPt2 As New Point3d
        newPt2 = Pt + (V * Length)
        arrPoints.Add(newPt2)

        Pt = newPt2
      End If

      If Rule = "[" Then
        Dim newPt As New Point3d(Pt)
        PtStack.Add(newPt)

        Dim newV As New Vector3d(V)
        VStack.Add(newV)
      End If

      If Rule = "]" Then
        Pt = PtStack(PtStack.Count() - 1)
        V = VStack(VStack.Count() - 1)

        PtStack.RemoveAt(PtStack.Count() - 1)
        VStack.RemoveAt(VStack.Count() - 1)
      End If

    Next
    Dim allLines As New List( Of Line )
    For i = 1 To arrPoints.Count() - 1 Step 2
      Dim line As New Line(arrPoints(i - 1), arrPoints(i))
      allLines.Add(line)
    Next
    PenroseLines = allLines
  End Sub
————————————————
求求帮帮小弟了 快哭了
 楼主| 发表于 2022-10-18 15:28:51 | 显示全部楼层
顶一下!!!!!!!!!!
回复

使用道具 举报

NCFZ微信公众号

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

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

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

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