Grasshopper

algorithmic modeling for Rhino

Hi! 

It is one of my first exercises in VB.NET. I'm trying to create a list of circles with different radius. I want to know what is wrong. Thanks!!!

Private Sub RunScript(ByVal Radius As List(Of Double), ByRef A As Object)

Dim ListCircles As New List (Of Rhino.Geometry.Circle)
For i As Integer = 0 To ListCircles.Count - 1
Dim Circle As New Rhino.Geometry.Circle(Radius)
ListCircles.add(Circle)
Next


A = ListCircles 
End Sub

Views: 342

Replies to This Discussion

For i As Integer = 0 To ListCircles.Count - 1

ListCircles has a length of zero when you start. You should use:

For i As Integer = 0 To Radius.Count - 1

--

David Rutten

david@mcneel.com

Thank You David!!!

Now...this is the translation error(BC30518):

Overload resolution failed because none of the 'New' functions that are accessed can be called with these arguments:
     'Public Sub New (arc As Rhino.Geometry.Arc)': Value of type 'System.Collections.Generic.List (Of Double)' can not be converted to 'Rhino.Geometry.Arc'.
     'Public Sub New (radius As Double)': Value of type 'System.Collections.Generic.List (Of Double)' can not be converted to 'Double'. (line 85)

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service