generative modeling for Rhino
Permalink Reply by Damien Alomar on August 31, 2010 at 7:39pm 'replace object with your specific type....
Dim myInputDataTree as New DataTree(of Object)
Dim myFlattenedList as New List(of Object)
DA.GetDataTree(someIndex, myInputDataTree)
myFlattenedList = myInputDataTree.AllData()
Permalink Reply by kermin chok on August 31, 2010 at 8:40pm
Permalink Reply by Damien Alomar on September 1, 2010 at 7:35am
Permalink Reply by kermin chok on September 2, 2010 at 3:36pm
Permalink Reply by Jon Sargent on October 14, 2010 at 9:37am 
Dim data As GH_Structure(Of GH_Line) = Nothing
If (Not DA.GetDataTree(0, data)) Then Return
Permalink Reply by Jon Sargent on October 14, 2010 at 12:20pm
Permalink Reply by Jonatan Schumacher on November 30, 2011 at 10:14am I found this tread very useful, thank you. For anyone interested in flattening input data in C#, I found that the following works:
<code> GH_Structure<GH_String> in_IDtree = new GH_Structure<GH_String>();
if(! DA.GetDataTree<GH_String>(0,out in_IDtree)) return;
List<GH_String> inIDList = new List<GH_String>(in_IDtree.FlattenData());</code>
I might add one thing here, could be useful for someone.
If you want to "enforce" flattening refer above, but if you want to leave flattening at the discretion of the user, but set the default to be flattened when the component is added to the canvas, add a line of code like below to the register input method:
pManager[0].DataMapping = GH_DataMapping.flatten;
Cheers,
Jon
© 2012 Created by Scott Davidson.
Powered by