C# how to refer rhinoscriptsyntax

i used python in grasshopper to make components referring to > help > rhinoscriptsyntax

now i am trying learn and decode C# script in grasshopper … but i cant find a way to refer these C# syntax to understand them

Only Python uses the RhinoScriptSyntax, which was developed to ease transition from RhinoScript to Python.

In C# you’ll have to switch to standard RhinoCommon classes and methods.

can you please help me out how to use rhinocommon… itz bit confusing

for example
referring to this C# script
i cant find " CreateTri " in RhinoCommon

    //Create an empty list of lines to hold our snowflake curves
    List<Line> lines = new List<Line>();
    //Call the CreateTri function and pass the radius and flip parameters
    Polyline tri = **_CreateTri_**(radius, flip);
    //Create an array of Lines by extracting the segements from the triangle
    Line[] triangle = tri.GetSegments();
    //Add these three lines to the lines List
    //Create a temporary list of lines
    List<Line> tempList = new List<Line>();
    //Begin the while loop
    int i = 0;
    while(i < num){
      //make sure the list is empty by calling the Clear() method
    A = lines;

And what’s the CreateTri function like?

i guess itz for making triangles

Not what for, what’s it like? I.e. how does it work? I don’t think it’s a McNeel function, unless someone has seriously changed naming conventions we tend to use.

CreateTri(radius, flip)

i have no idea sir

Polyline triangle = CreateTri();
List<Line> lines = new List<Line>(triangle.GetSegments());

for (int i = 0; i < num; i++)
  List<Line> temporary = new List<Line>(lines);
A = lines;

This would be the C# way of doing it, but the CreateTri() and CreateKochSnowflake() methods are not available in Rhino. I don’t know where you go them from but I imagine they are provided by some sort of python import.

1 Like

gh-csharp-adv02.cs (3.2 KB)

i got this from a tutorial


Dude it’s already in C#…

1 Like

you mean CreateTri() is in C# by default ?

That webpage shows the source of the CreateTri and KochSnowflake methods in C#.

1 Like

thanx man !!:kissing_heart::kissing_heart: