Hi David,

It worked just like I wanted, but do you know of a command that could
close the polyline inside the vb.net script component?
Thanks for the great help.

Cheers

Christian

On 19 Jan., 14:44, David Rutten <[email protected]> wrote:
> Hi Christian,
>
> Assuming you'll use a VB.NET script component, you'll need to have 2
> inputs and 1 output:
>
> [in]   List of points
> [in]   a single integer (11 in your example)
> [out] a list of polylines
>
> the code should look something like:
>
> ----------------------------------------
>   Sub RunScript(ByVal x As List(Of On3dPoint), ByVal y As Integer)
>     Dim pline_list As New List(Of OnPolyline)
>     Dim pline As OnPolyline
>
>     Dim N As Integer = 0
>     For i As Integer = 0 To x.Count -1
>       If ((i Mod y) = 0) Then
>         If (pLine IsNot Nothing) Then pline_list.Add(pline)
>         pLine = New OnPolyline()
>       End If
>
>       pline.Append(x(i))
>     Next
>
>     If (pline IsNot Nothing) AndAlso (pline.Count > 1) Then
> pline_list.Add(pline)
>
>     A = pline_list
>   End Sub
> --------------------------------------------
>
> I just wrote this directly so don't expect it to be flaw-less.
>
> --
> David Rutten
> [email protected]
> Robert McNeel & Associates
>
> On Jan 19, 2:18 pm, Raun <[email protected]> wrote:
>
> > Hi,
>
> > I have just finished manually sorting and connecting points to a
> > polyline and I now really want to be able to have a scripting
> > component that will for example take the first 11 points of a point
> > list and append it to a polyline and then take the next 11 points and
> > append to another polyline. My scripting abilities are very bad but I
> > know I should use a counter to count the list, and the append to
> > append to a polyline. But everything in between is a little unclear
> > for me right now.
>
> > If you know of a good example of this, that I have missed in the group
> > please tell me and I will try to myself. Learning by doing right...
>
> > Cheers
>
> > Christian

Reply via email to