I want to make a C# script in GH that will bake a brep into my Rhino document. This will eventually be part of a larger program using a button in UI. I don’t want to have to go back to the GH document and right click on the Swp2 component in order to bake the brep.
Here is a very simple GH file that creates a thing and the C# module that I have started. It shows that it recognizes the object as a Brep.simple-bake-C#.gh (8.7 KB)
I did something similar to this a while ago in Python but that was only a curve where I used code like this
#switch contect to Rhino scriptcontext.doc = Rhino.RhinoDoc.ActiveDoc #add the geometry curve= scriptcontext.doc.Objects.Add(geometry) #switch contect back to gh scriptcontext.doc = ghdoc
But now I am in C# and I can’t figure out the equivalent C# thing for “scriptcontext.doc”.
It’s probably very simple, but remember I’m just learning C# and still have a long way to go learning the Rhino classes.