protected override void SolveInstance(IGH_DataAccess DA) { GH_Point point = new GH_Point(); Grevit.Types.Wall wall = null; GH_String layer = new GH_String(""); GH_String style = new GH_String(""); List <Parameter> param = new List <Parameter>(); if (!DA.GetDataList <Parameter>("Parameters", param)) { param = new List <Parameter>(); } DA.GetData <GH_Point>("Point", ref point); DA.GetData <GH_String>("Layer", ref layer); DA.GetData <GH_String>("Style", ref style); DA.GetData <Wall>("wall", ref wall); Door d = new Door(); SetGID(d); d.stalledForReference = true; d.TypeOrLayer = layer.Value; d.FamilyOrStyle = style.Value; d.locationPoint = point.ToGrevitPoint(); d.parameters = param; SetGID(d); Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(point.Value, 0.5); Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(0, 0, 2)); SetPreview(d.GID, srf.ToBrep()); GH_Surface ghb = new GH_Surface(srf); DA.SetData("GrevitComponent", d); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_Curve baseline = new GH_Curve(); GH_String layer = new GH_String(""); GH_Number height = new GH_Number(); GH_String style = new GH_String(""); List<Parameter> param = new List<Parameter>(); if (!DA.GetDataList<Parameter>("Parameters", param)) param = new List<Parameter>(); //DA.GetData<GH_String>("Family", ref family); DA.GetData<GH_String>("Layer", ref layer); DA.GetData<GH_String>("Style", ref style); DA.GetData<GH_Number>("Height", ref height); DA.GetData<GH_Curve>("Baseline", ref baseline); Wall w = new Wall(style.Value,layer.Value,param, baseline.ToGrevitCurve(),"",height.Value,true,false); SetGID(w); Rhino.Geometry.Surface srf = Rhino.Geometry.Surface.CreateExtrusion(baseline.Value, new Rhino.Geometry.Vector3d(0, 0, height.Value)); SetPreview(w.GID, srf.ToBrep()); DA.SetData("GrevitComponent",w); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_Curve baseline = new GH_Curve(); GH_String level = new GH_String("none"); GH_Number height = new GH_Number(); GH_Number offset = new GH_Number(); GH_Boolean join = new GH_Boolean(true); GH_Boolean flip = new GH_Boolean(false); GH_String family = new GH_String(""); GH_String type = new GH_String("none"); List<Parameter> parameters = new List<Parameter>(); if (!DA.GetDataList<Parameter>("Parameters", parameters)) parameters = new List<Parameter>(); DA.GetData<GH_Boolean>("Join", ref join); DA.GetData<GH_String>("Type", ref type); DA.GetData<GH_String>("Levelbottom", ref level); DA.GetData<GH_Number>("Height", ref height); DA.GetData<GH_Curve>("Baseline", ref baseline); DA.GetData<GH_Boolean>("Flip", ref flip); Wall wall = new Wall(family.Value, type.Value, parameters, baseline.ToGrevitCurve(), level.Value,height.Value,join.Value,flip.Value ); Rhino.Geometry.Surface srf = Rhino.Geometry.Surface.CreateExtrusion(baseline.Value, new Rhino.Geometry.Vector3d(0, 0, height.Value)); SetGID(wall); SetPreview(wall.GID, srf.ToBrep()); DA.SetData("GrevitComponent", wall); }