Grasshopper

algorithmic modeling for Rhino

Hi all,

I try to divide surface with VB, but I got this error message :

Error: Value of type '1-dimensional array of Rhino.Geometry.Surface' cannot be converted to 'Rhino.Geometry.Surface'. (line 96)

I think there is something wrong with my script. Any ideas to used Surface.Split Method in VB script?

Private Sub RunScript(ByVal S As Surface, ByVal U As Integer, ByVal V As Integer, ByRef Srf As Object)
Dim SrfList As New List (Of Surface)
Dim uStep As Double = 1 / U
Dim vStep As Double = 1 / V

For i As Integer = 0 To U - 1
  For j As Integer = 0 To V - 1
    Dim USrf As Surface = S.Split(0, uStep * i)
    Dim VSrf As Surface = USrf.Split(1, vStep * j)
    SrfList = VSrf
  Next
Next


Srf = SrfList
End Sub

Thanks for advance

Views: 504

Replies to This Discussion

I find out with this :

Dim SrfList As New List (Of Surface())

 .....

   Dim USrf() As surface = S.Split(0, uStep * i)
   Dim VSrf() As surface = S.Split(1, vStep * j)
   SrfList.add(VSrf)
 .....

But, I got the strange output :

Rhino.Geometry.Surface[]

Data conversion failed from Goo to Surface

Any ideas?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service