Generate Grids with VB.NET

This is an example of how to create a rectangular and diamond grids using VB.NT DataTrees to output a tree structure. Download Diagrid_GH09.gh to see the GH definition.

  • Torolf Sauermann

    interesting work :)

    ciao
    torolf
  • Alessio Erioli

    Thanks a lot Rajaa!
  • Rajaa Issa

    you welcome :)
  • Jon Malkovich

    Hi Rajaa,
    I actually don't understand the j=0 and j=1 declaration within the if statement. Isn't it redundant? Am I missing something?
    Best,

    Giulio
  • Rajaa Issa

    You are right, it is redundant... I actually implemented it differently to start with and this was unnecessarily left in.
  • cmrhm

    Hi, Rajaa:

    I am going to study your code. Wondering if you can put a sequence number on each point?

    cmrhm
  • Rajaa Issa

    Hi cmrhm,
    I'm not sure I understand what you mean by "put sequence number on each point". Can you elaborate or give an example?
  • cmrhm

    Like the following.

    in your code:

    For j = 0 To v_num - 2
    Dim CurrPt As New On3dPoint(curr_x + j * dis, curr_y + i * dis / 2, z)
    grid.Add(CurrPt, path)
    Next

    is there anyway to write out the coordinates for each point CurrPt?

    Q_howToSetSequenceNumber.png
  • cmrhm

    Also write out the sequence numbers when each point was put into Rhino interface? For example, You output 190 points, so point(0,0,0) must be the first one. How I can write 1 around this pint?
  • Rajaa Issa

    Hi,
    When you examine the script, you'll see that:
    A: the output of the script, is a 2d array of points. Points show on screen.

    Now when you say "write out the coordinates for each point", where do you want to write it? On screen? Or, do you mean that we construct a one dimensional array of these points? If so, you can flatten the output "A".

    Also, when you say "sequence", do you mean to output a number on screen? If so, you can use the flat list of points and "Point List" component in GH for this.

    Does that answer your question?
  • Rajaa Issa

    Here is an image for what is described below..

  • cmrhm

    Rajaa:

    Thanks for pointing out using component 'point list' and the posted image! That is exactly what I am looking for.
  • Justin Diles

    Rajaa: Now I've figured everything out and realize how to use Data Trees just like multidimensional arrays (but even better) in a VB.net component. Thanks for your original example; it got the ball rolling for me. Best, J
  • Rajaa Issa

    That is great.
  • Justin Diles

    Rajaa: Do you know if it is possible to use the RhUtil.RhinoInterpCurve function with a Data Tree branch (full of points) to make a curve? It works to create a Control Point curve: "crv.CreateClampedUniformNurbs(3,data_tree.Branch(0).ToArray, Nothing, Nothing,1)"...But trying something similar with the InterpCurve function has not worked for me so far.
  • Sebastian Pantano

    Rajaa Hello, very interesting all the data found in several of its definitions. I'm trying to study definitions to create neighborhoods housing structures that can be flexible and evolve over time. Targeted to respond in the best way to human needs. this I am trying to develop armed grids excel and through VB.net read in grasshopper. Any help or recommendation would be of great interest to me.
    from already thank you very much.
    Sebastian.