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
e now contains (40x3x11=)1320 points with a branch structure of {0-39,0-2} i.e
{0;0}
{0;1}
{0;2}
{1;0}
...
{39;2}
with each branch containing 11 points.
I now want to create lines from the points on line {x;0} to {x;1}, {x;1} to {x;2}, and {x;2} to {x;0}, which will give me a triangular grid on each triangle. How do i do this? I think I need to split the tree 40 times to give me 40 single layered trees but I imagine there's a cleverer way of doing this!
This feel like it should be simple, but I;m having trouble working with the double-layered branch structure. Any help would be greatly appreciated!
Thanks,
Matt…