nput parameter and then set the named values on the second?
protected override void BeforeSolveInstance() { Param_Integer param0 = Params.Input[0] as Param_Integer; Param_Integer param1 = Params.Input[1] as Param_Integer; param1.ClearNamedValues();
GH_Structure<GH_Integer> data = param0.VolatileData as GH_Structure<GH_Integer>; if (data.IsEmpty) return; foreach (GH_Integer value in data.AllData(true)) { switch (value.Value) { case 1: param1.AddNamedValue("First option for 1", 11); param1.AddNamedValue("Second option for 1", 12); param1.AddNamedValue("Third option for 1", 13); break;
case 2: param1.AddNamedValue("First option for 2", 21); param1.AddNamedValue("Second option for 2", 22); param1.AddNamedValue("Third option for 2", 23); break;
case 3: param1.AddNamedValue("First option for 3", 31); param1.AddNamedValue("Second option for 3", 32); param1.AddNamedValue("Third option for 3", 33); break; } return; } }
--
David Rutten
david@mcneel.com…
Added by David Rutten at 1:56am on December 18, 2013
etting when I merge the three trees, but what I would like to get is:
essentially a tree with 27 branches, each with a single list of either 11 or 21 points.
{0} (N=11)
{1} (N=11)
...
{10} (N=21)
{11} (N=21)
...
{17} (N=11)
{18) (N=11)
{27} (N=11)
Any help would be greatly appreciated.
All the best,
Matt
…
Added by Matt Schmid at 3:06pm on December 4, 2010
e screenshot, there are only two ROT3D(rotation 3d) commands and SEC (Brep/Plane Section) are defined, it seems that the cylinders are generated at first, and the rotated planes are used to intersect the cylinders, in order to generate the curves.
[Figure 1]
The redrawing is based on the previous assumpation, and there are 21 pairs of cross-arc drawn[Figure 1]. Finally, the problem is focused on the last step how to intersect curves.
In CCX, there are only 21 run times, which means the curves intersection are looped one-by-one, and 21 curves are arranged to finished 21 intersection[Figure 2, plz zoom in]. That is the reason, why CCX is not able to get the cross points between the neighbour arc.
[Figure 2]
For the curve-to-curve intersection does not work, in order to get the intersection points, I try to enlarge the set of intersected component, using the plane or cylinder to intersect with curve. When the PCX (plane-curve-intersect) is tested, 21 curves are intersected with the previous 21 rotated planes, the loop runs 441 times, which shows that the curves are mananged to intersect with the neighbour plane, and the intersection points are found. Moreover, the SCX (surface-curve-intersect) is tested, and the 21 cylinders are successfully intersected with the 21 curves. And more important point is that the SCX makes the intection points exactly between the curves and the cylinders, while the redundant ones of the intersection of plane and curve, in some combination of the rotated angles and cylinder distances, are are avoided.
Besides, the Graft/Merge command is also tried, I hope to merge the curves list together, and to intersect them with each other, but it fails. It is supposed that the graft command may change the data structure. When a list of cylinders are grafted, the new data is no longer the cylinders, which fails to plot.
In conclusion, if the loops of geometry are in the same level, the command is run in correspondence; if the loop is between different types of geometry, the total trials of loop are run.
[Rhino Version 5.0; Grasshopper 0.9.0076]
BTW, the .gh file includes the initial base line, which could be run directly in Grasshopper. Please help me to check the model, thanks.…