but the commas in this case are interpreted as group separators (as in 1,573.99) and are thus ignored.
As for the mysterious one, 25 written in binary is 00011001 and 175 written in binary is 10101111. The vertical bar symbol is the C-language OR operator, which results in a 1 if any of the inputs is 1. Thus:
00011001 OR 10101111 = 10111111
which equals 191.
To make it work you should call AssignDataToParameter not with a single string, but with an array of 5 items.
Dim array() ReDim array(4) array(0) = 25 array(1) = 0 array(2) = 0 array(3) = 0 array(4) = 175 Call GH.AssignDataToParameter(id, array) Call GH.RunSolver(False)
My RhinoScript at the moment doesn't work for some reason, so I couldn't test this.
--
David Rutten
david@mcneel.com…
ems in the same way. Lofting was particularly difficult, you had to have a separate loft component for every lofted surface that you wanted to generate because the component would/could only see one large list of inputs. Then came along the data structures in GH v0.6 which allowed for the segregation of multiple input sets.
If you go to Section 8: The Garden of Forking Paths of the Grasshopper Primer 2nd Edition you will find the image above describing the storing of data.
Here you will notice a similarity between the path {0;0;0;0}(N=6) and the pathmapper Mask {A;B;C;D}(i). A is a placeholder for all of the first Branch structures (in this case just 0). B is a place holder for all the second branch structures possibly either 0, 1 or 2 in this case. And so forth.
(i) is a place holder for the index of N. If you think of it like a for loop the i plays the same role. For the example {A;B;C;D}(i) --> {i\3}
{0;0;0;0}(0) --> {0\3} = {0}
{0;0;0;0}(1) --> {1\3} = {0}
{0;0;0;0}(2) --> {2\3} = {0}
{0;0;0;0}(3) --> {3\3} = {1}
{0;0;0;0}(4) --> {4\3} = {1}
{0;0;0;0}(5) --> {5\3} = {1}
{0;0;0;1}(0) --> {0\3} = {0}
{0;0;0;1}(1) --> {1\3} = {0}
{0;0;0;1}(2) --> {2\3} = {0}
{0;0;0;1}(3) --> {3\3} = {1}
{0;0;0;1}(4) --> {4\3} = {1}
{0;0;0;1}(5) --> {5\3} = {1}
{0;0;0;1}(6) --> {6\3} = {2}
{0;0;0;1}(7) --> {7\3} = {2}
{0;0;0;1}(8) --> {8\3} = {2}
...
{0;2;1;1}(8) --> {8\3} = {2}
I'm not entirely sure why you want to do this particular exercise but it goes some way towards describing the process.
The reason for the tidy up: every time the data stream passes through a component that influences the path structure it adds a branch. This can get very unwieldy if you let it go to far. some times I've ended up with structures like {0;0;1;0;0;0;3;0;0;0;14}(N=1) and by remapping the structure to {A;B;C} you get {0;0;1}(N=15) and is much neater to deal with.
If you ever need to see what the structure is there is a component called Param Viewer on the first Tab Param>Special Icon is a tree. It has two modes text and visual double click to switch between the two.
Have a look at this example of three scenarios in three situations to see how the data structure changes depending on what components are doing.
…
ches it with the first branch in Tree B (and then the first branch in Tree C if more than two trees are involved).
I'm planning to add better branch matching logic, but I'm not going to touch it until I have a good idea about what's needed and how it can be accomplished without breaking existing files.
So, the branch "address" is only used to sort the branches in a single tree. Thus, a tree with the following branches is always sorted in the exact same way:
{0;0}
{0;1}
{0;2}
{0;3;0}
{0;3;1}
{1;6}
If you have another tree with different branches:
{0}
{1}
{2}
{3}
{4}
{5}
Then the matching will be:
{0;0} -> {0}
{0;1} -> {1}
{0;2} -> {2}
{0;3;0} -> {3}
{0;3;1} -> {4}
{1;6} -> {5}
As long as people adhere to your advice: "it is best for the addresses of each tree branch to be in the same format", there will be no problem. But it is at the moment extremely difficult to perform complex matchings.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 9:25am on August 11, 2010