Grasshopper

algorithmic modeling for Rhino

HI

I try it again. Question is simple, but i have still a same problem with this. How i can make "x"d array input to VB component. I would to make some array (temp(12)(3), .. etc.) in the first VB and send it in the same format to another VB. Attached file show two possibility, first with DataTree, second with ArrayList type. How to make it correct?

Please some help, Best
Joach

Views: 948

Attachments:

Replies to This Discussion

This will be tricky, since Grasshopper will attempt to "unroll" enumerable types such as Arrays in order to transform them into Grasshopper data structures.

Is serialization an option? (i.e. convert your data to a string, pass the string, then uncompile it back into data on the other end)
Hello, I'm having similar problem. Could you explain how to do serialization?

Hi Danijel,

 

can you explain precisely what it is you need to accomplish?

 

Serialization is the process of converting run-time data into storable data, usually Strings or ByteArrays. The easiest I think would be to create an Xml string out of your data. Grasshopper comes with a dll (GH_IO.dll) which has a bunch of classes that make it exceedingly easy to write and read Xml strings.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi Danijel,

If I understand your question correctly you would be better of switching to the new vb component (using Rhinocommon). These have 3 ways to access input variables (item access, list access and DataTree access). If you output data from one component as DataTree you can input it again in another component as DataTree. Then it's possible to access the data in a way similar to a multidimensional array using   InputTree.Branch(x)(y)

 

Private Sub RunScript(ByVal InputTree As DataTree(Of System.Object), ByVal x As Integer, ByVal y As Integer, ByRef A As Object)
    'your code goes here…

    A = InputTree.Branch(x)(y)

End Sub

Attachments:
Thanks for the simple solution!

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