Grasshopper

algorithmic modeling for Rhino

I have a script that takes a collection of points and then one by one calls a recursive subroutine. For each point the subroutine produces an array of points. This array is then added to another array called AllPoints. My VB script then feeds this output into a Point parameter and this is where I get an error. I realize that the Point parameter is expecting points but I would think that it would also accept an array of arrays of points. 

this is what I get as output from my VBscript when I feed it two points.
System.Collections.Generic.List'1
[RMA.opeNURBS.On3dPoint]
System.Collections.Generic.List'1
[RMA.opeNURBS.On3dPoint]

Any suggestions on what to do. I can't flatten the list because i eventually what to draw separate curves through each set of points.

Thanks.

Views: 1094

Replies to This Discussion

You should move this topic to the "VB and C# Corner" discussion area. You'll get the attention of the people more likely to be able to answer...
good idea thanks.
You can't supply arrays of arrays of data as an output. You need to specifically construct a Grasshopper.DataTree and assign that to the output.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
David not to sound dense but is this what you are talking about
http://www.grasshopper3d.com/forum/topics/c-datatrees
and if so will you always have to do this(seems a little convoluted, although maybe there is a reason i don't see :))
No, this is for inputting DataTrees, not outputting DataTrees. Inputting is not possible yet, you can at best get a single list of data.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Sure, but couldn't I use the same logic to create a DataTree for output?
You can't get data trees as input, so there's no such "same logic".

I have a feeling we're talking at at least a 30 degree angle here....

If a single run of your script generates a single list of Points, then you can assign any class that implements IEnumerable to the output. Be it an array of points, or a List(Of On3dPoint) or whatever else. If you must assign a more complicated structure, then you have to build a DataTree. Grasshopper does not understand lists-of-lists, so this will not work.

I probably could write some logic that recursively parses nested collections and invents some sort of data tree path structure to go along with it, but what are the odds this is the layout you had in mind?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Definitely talking at 30 degrees!

I think I understand but now that I am at home I can attach the files I am talking about an maybe clear things up - thanks for everything.
Attachments:
David, I think we weren't understanding each other because you probably assumed that I would not miss such a simple solution. Basically, the script I wrote for 1 point works for many points. I realized after looking at the primer again(section 14.11) that there is no reason to process all of points at once and hence no reason to output an array of arrays. Thanks again for the help. I have incl the working definition in case any one is interested.
Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service