Ok,
The loop is used to "repeat" a "block of code" some defined "number of
times". Whatever you put inside the loop (the block of code) will be
excuted that many number of times.
For example, if you like to define a list of 10 points that have same
x and y values, but changes z by 0.5, then you can do the following:
'Declare loop counter
Dim i As Integer
'Declare a new list of points
Dim points As New List(Of On3dPoint)
'For Loop Start
'Start the loop by defining the initial value of the loop counter,
limit and optionally (step or loop increment)
For i = 0 To 9 Step 1
'Declare a new point
Dim pt As New On3dPoint
pt.x = 0.0
pt.y = 0.0
pt.z = i * 0.5
'Add the new point to the list
points.Add(pt)
'When reaching "Next", the loop counter is incremented by the
"Step" value
'The the code jumps back to the start of the for loop to check
if the limit was passed (9 in this case):
' If true: then exit the loop
' If not: then excute what is inside the loop one more time
Next
'For Loop Exited...
Hope that helps.
On Dec 15, 10:10 am, Rajaa <[email protected]> wrote:
> Hi,
> I'll write you a detailed sample and point soon.
>
> On Dec 9, 1:15 pm, holbrd <[email protected]> wrote:
>
>
>
> > Hi all-
>
> > I have been using grasshopper for sometime now and one area that I am
> > trying to get better using is the vb.net components for looping. I am
> > new to vb.net and don't know much structure. I was wondering if anyone
> > could help with a general breakdown of what needs to be in a general
> > structure for a loop component. I know that much of this depends on
> > what exactly you are trying to loop, but any idea on syntax would be
> > helpful.
>
> > thks- Hide quoted text -
>
> - Show quoted text -