Grasshopper

algorithmic modeling for Rhino

in my VS project i have a data tree:

Grasshopper.DataTree<On3dPoint> op = new Grasshopper.DataTree<On3dPoint>();

when i try to set that to a property like,

iData.SetDataList(0, op);

i get the following error. how to i set a data tree. also note that iData at index 0 is set as Register_PointParam(....)



Argument '2': cannot convert from 'Grasshopper.DataTree<RMA.OpenNURBS.On3dPoint>' to 'System.Collections.IEnumerable'

Views: 671

Replies to This Discussion

try setdatatree
Hi Robert,

the Grasshopper.DataTree is only meant for VB and C# components. If you're writing a custom component I suggest you use Grasshopper.Kernel.Data.GH_Structure. It's a bit more powerful than DataTree and it will run marginally faster since GH_Structure is what I actually use to store data inside the parameters.

When assigning trees to output parameters, don't use DA.SetDataList() but DA.SetDataTree().

--
David Rutten
david@mcneel.com
Poprad, Slovakia
thank you, i do not know why i did not notice the setDataTree method. also thanks for letting me now about GH_structure. i will give it a try

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service