NCF参数化建筑论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 7249|回复: 1
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
1m
发表于 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
————————————————
求求帮帮小弟了 快哭了
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享
2m
 楼主| 发表于 2022-10-18 15:28:51 | 只看该作者
顶一下!!!!!!!!!!

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

GMT+8, 2024-11-22 15:41 , Processed in 0.060110 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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