Manage branches

Where can I find how to manage branches that come out of the component?

For example, Using Visual Studio C# I have created a component that creates a grid. It is now one branch for all points. I would like a seperate branch for each row containing the points like in the rectangular grid component:

Hi Peter,
If you are using a datatree as output, you will have to add the points like this: mypoint3dtree.AddPoint(myPoint3d,new Gh_Path(i,j));

Thank you.

I am probably not using a tree here since your suggestion is noted by the autocorrect:

I used:

image

You could have a look at my first post here:


If you want to use datatrees in visual studio, copy the “using statements” from the c# component to your visual studio file

Thank you. This helped:

image

About the using statements. It feels like I have added some that I do not use at the moment. Do you always include these just to be sure you can always use them? Or is it good practise to remove those you do not use?

To be honest, I dont know, I assume it just affects the time once you open the project and when compiling it.
Probably you dont need all the grasshopper namespaces,I always forget which one contains the datatree structure so I just copy all of them.
Also not sure why there is System.Drawing,Sytem.Windows.Forms etc., did you use the grashopper template for visual studio?

In general I prefer keep the stuff as clean as possible, but in this case I just let them since they do not affect anything notable for me.

Visual studio will grey out those using statements you don’t need. It will also usually offer to add this you do need after typing the name of a type which is not currently imported yet.

1 Like