NCF参数化建筑论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
123
返回列表 发新帖
楼主: panhao1
打印 上一主题 下一主题

[VB & C#] 详解GH自身的数据结构

[复制链接]
3m
 楼主| 发表于 2010-5-9 22:38:58 | 只看该作者
也许大家就要问了 为什么是structure而不是datatree
在我用C#时有提示说在运算器用datatree 在VS里用structure
估计与gh的装箱拆箱的限制有关
再看这段代码
    Dim strip As Boolean
    ' Dim struct As New GH_Structure(Of Grasshopper.Kernel.Types.GH_Goo)
    '  For i As int32= 0 To x.count - 1
    '  Dim db As New Grasshopper.Kernel.Types.GH_number(x(i))
    '    struct.Append(db)
    '  Next
    '  Dim struct2 As New GH_Structure(Of Grasshopper.Kernel.Types.GH_Goo)
    '  struct2.MergeStructure(struct)
    '  Dim VB As IEnumerator(Of GH_Path)
    '  VB = struct.Paths.GetEnumerator
    '  Do While VB.MoveNext
    '    Dim path As GH_Path = VB.Current
    ' struct2.ExtrudePath(path, strip)
    '  Loop
    '  If (Not VB Is Nothing) Then VB.Dispose
    'A = struct.Paths

是根据源代码的改写 只不过structure是无法输出的类型
2m
 楼主| 发表于 2010-5-9 22:34:50 | 只看该作者
本帖最后由 panhao1 于 2010-5-9 22:51 编辑

里面的代码和这个极其类似

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

GMT+8, 2024-6-16 05:56 , Processed in 0.061093 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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