e a list of coordinates which I need to sort in groups as per a series of numbers in another list. Both are txt files which I'm reading to bring a series of points in but those points are generated with a corresponding index.
Of course the lists are not sorted in any way, but the numbers are corresponding so it looks like a series of 9, 6, 7, 2, 8, 0, 9, 5, 6, 4, 2, 3, 8, 5, 5, 6, 9, 4 in one file( and series of (X, Y, Z) coordinates in the other.
The question is how can I make it to sort the list and then split it per index... if it is possible... or should I just do this in excel and bring clean lists in?
My idea, if it works, is use the series of points to generate paths and work with them.
I'll attach the lists just if it helps making a clear idea.
Any advice will be very welcome.…
Integer = 0 To 9
val *= 2
lst.Add(val)
Next
Since val is a ValueType, when we assign it to the list we actually put a copy of val into the list. Thus, the list contains the following memory layout:
[0] = 2
[1] = 4
[2] = 8
[3] = 16
[4] = 32
[5] = 64
[6] = 128
[7] = 256
[8] = 512
[9] = 1024
Now let's assume we do the same, but with OnLines:
Dim ln As New OnLine(A, B)
Dim lst As New List(Of OnLine)
For i As Integer = 0 To 9
ln.Transform(xform)
lst.Add(ln)
Next
When we declare ln on line 1, it is assigned an address in memory, say "24 Bell Ave." Then we modify that one line over and over, and keep on adding the same address to lst. Thus, the memory layout of lst is now:
[0] = "24 Bell Ave."
[1] = "24 Bell Ave."
[2] = "24 Bell Ave."
[3] = "24 Bell Ave."
[4] = "24 Bell Ave."
[5] = "24 Bell Ave."
[6] = "24 Bell Ave."
[7] = "24 Bell Ave."
[8] = "24 Bell Ave."
[9] = "24 Bell Ave."
To do this properly, we need to create a unique line for every element in lst:
Dim lst As New List(Of OnLine)
For i As Integer = 0 To 9
Dim ln As New OnLine(A, B)
ln.Transform(xform)
lst.Add(ln)
Next
Now, ln is constructed not just once, but whenever the loop runs. And every time it is constructed, a new piece of memory is reserved for it and a new address is created. So now the list memory layout is:
[0] = "24 Bell Ave."
[1] = "12 Pike St."
[2] = "377 The Pines"
[3] = "3670 Woodland Park Ave."
[4] = "99 Zoo Ln."
[5] = "13a District Rd."
[6] = "2 Penny Lane"
[7] = "10 Broadway"
[8] = "225 Franklin Ave."
[9] = "420 Paper St."
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 6:26am on September 9, 2010
ements between mid axes of elements ( being perpendicular to both). On the attached image, the links are the small elements connectiong nodes 4 to 5, 6 to 7 and 8 to 9. All nodes (1 to 9 including 1', 2', 3') are defined in Karamba as fixed supports but nodes 1,1', 2, 2', 3, and 3' have hinges added with the beam joint component. The freed rotations are shown on the figure.
I wondered if that was the correct way of defining such a structure in Karamba bearing in mind that nodes 1', 2' and3' are free nodes in the reality.
Thanks again for your help !
Yousef…
4 to 9
Is there a way to do this with the list or sequence components other than retrieving individual list items and then lofting between each list item (circle). There must be a more elegant way to do this.
Thanks very much.
please see the attached definition as a sample...…
nts me this:
[[0], [0, 1], [0, 1, 2], [0, 1, 2, 3], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 4, 5, 6, 7]]
this is what I wanted but how to convert this to tree in grasshopper?
In grasshopper I just get:
8x IronPython.Runtime.List…