using Grasshopper.Kernel;
namespace WindowGenerator
public class WindowComponent : GH_Component
public WindowComponent() : base("Window", "Window", "Generates a window with customizable size within a fixed shape of 10' by 10'", "MyPlugin", "Windows")
protected override void RegisterInputParams(GH_InputParamManager pManager)
pManager.AddNumberParameter("Width", "W", "Width of the window (in feet)", GH_ParamAccess.item);
pManager.AddNumberParameter("Height", "H", "Height of the window (in feet)", GH_ParamAccess.item);
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
pManager.AddGenericParameter("Window", "W", "The generated window", GH_ParamAccess.item);
protected override void SolveInstance(IGH_DataAccess DA)
if (!DA.GetData(0, ref width))
if (!DA.GetData(1, ref height))
Rectangle3d windowShape = new Rectangle3d(Plane.WorldXY, width, height);
Brep window = Brep.CreatePlanarBreps(windowShape.ToNurbsCurve())[0];
public override GH_Exposure Exposure => GH_Exposure.primary;
protected override System.Drawing.Bitmap Icon => null;
public override Guid ComponentGuid => new Guid("CE80B75E-12C3-42A3-8F8F-F0B9FE7E2D55");