protected override void SolveInstance(IGH_DataAccess DA) { GH_String style = new GH_String(""); GH_String layer = new GH_String(""); GH_Point stop = new GH_Point(); GH_Point sbtm = new GH_Point(); List <Parameter> param = new List <Parameter>(); if (!DA.GetDataList <Parameter>("Parameters", param)) { param = new List <Parameter>(); } DA.GetData <GH_String>("Style", ref style); DA.GetData <GH_String>("Layer", ref layer); DA.GetData <GH_Point>("PointTop", ref stop); DA.GetData <GH_Point>("PointBottom", ref sbtm); Column s = new Column(style.Value, layer.Value, param, sbtm.ToGrevitPoint(), stop.ToGrevitPoint(), "", true); SetGID(s); Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(sbtm.Value, 0.5); Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(new Rhino.Geometry.Point3d(stop.Value.X - sbtm.Value.X, stop.Value.Y - sbtm.Value.Y, stop.Value.Z - sbtm.Value.Z))); SetPreview(s.GID, srf.ToBrep()); DA.SetData("GrevitComponent", s); }
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_Point curve = new GH_Point(); DA.GetData <GH_Point>("Point", ref curve); GH_String layer = new GH_String(string.Empty); DA.GetData <GH_String>("Layer", ref layer); DrawingPoint arc = new DrawingPoint(); arc.point = curve.ToGrevitPoint(); arc.TypeOrLayer = layer.Value; arc.GID = this.InstanceGuid.ToString(); DA.SetData("GrevitComponent", arc); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_String content = new GH_String(); GH_Point location = new GH_Point(); GH_String view = new GH_String(); List<Parameter> parameters = new List<Parameter>(); if (!DA.GetDataList<Parameter>("Parameters", parameters)) parameters = new List<Parameter>(); DA.GetData<GH_Point>("Location", ref location); DA.GetData<GH_String>("Text", ref content); DA.GetData<GH_String>("View", ref view); TextNote textnote = new TextNote(); textnote.text = content.Value; textnote.view = view.Value; textnote.location = location.ToGrevitPoint(); textnote.parameters = parameters; textnote.GID = this.InstanceGuid.ToString(); DA.SetData("GrevitComponent", textnote); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_String level = new GH_String("none"); GH_String family = new GH_String("none"); GH_String type = new GH_String("none"); GH_Point topPoint = new GH_Point(); GH_Point bottomPoint = new GH_Point(); GH_String gid = new GH_String(""); List<Parameter> parameters = new List<Parameter>(); if (!DA.GetDataList<Parameter>("Parameters", parameters)) parameters = new List<Parameter>(); DA.GetData<GH_String>("Family", ref family); DA.GetData<GH_String>("Type", ref type); DA.GetData<GH_String>("Level", ref level); DA.GetData<GH_Point>("PointTop", ref topPoint); DA.GetData<GH_Point>("PointBottom", ref bottomPoint); DA.GetData<GH_String>("GID", ref gid); Column column = new Column(family.Value,type.Value,parameters, topPoint.ToGrevitPoint(), bottomPoint.ToGrevitPoint(),level.Value,true); SetGID(column); Rhino.Geometry.Circle circle = new Rhino.Geometry.Circle(bottomPoint.Value,0.5); Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(circle.ToNurbsCurve(), new Rhino.Geometry.Vector3d(new Rhino.Geometry.Point3d(topPoint.Value.X-bottomPoint.Value.X,topPoint.Value.Y-bottomPoint.Value.Y,topPoint.Value.Z-bottomPoint.Value.Z))); SetPreview(column.GID, srf.ToBrep()); DA.SetData("GrevitComponent", column); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_Surface surface = new GH_Surface(); GH_String level = new GH_String(); GH_String family = new GH_String(""); GH_String type = new GH_String(""); GH_Boolean structural = new GH_Boolean(false); GH_Number slope = new GH_Number(0.0); List<Parameter> parameters = new List<Parameter>(); if (!DA.GetDataList<Parameter>("Parameters", parameters)) parameters = new List<Parameter>(); DA.GetData<GH_Surface>("Surface", ref surface); GH_Point slopeTopPoint = new GH_Point(surface.Value.Edges[0].PointAtStart); GH_Point slopeBottomPoint = new GH_Point(surface.Value.Edges[0].PointAtEnd); //DA.GetData<GH_String>("Family", ref family); //DA.GetData<GH_String>("Type", ref type); DA.GetData<GH_String>("Levelbottom", ref level); DA.GetData<GH_Boolean>("Structural", ref structural); DA.GetData<GH_Point>("SlopeTopPoint", ref slopeTopPoint); DA.GetData<GH_Point>("SlopeBottomPoint", ref slopeBottomPoint); DA.GetData<GH_Number>("Slope", ref slope); Slab slab = new Slab(); slab.FamilyOrStyle = family.Value; slab.TypeOrLayer = type.Value; slab.levelbottom = level.Value; slab.structural = structural.Value; slab.surface = new Profile(); slab.surface.profile = new List<Loop>(); Loop loop = new Loop(); loop.outline = new List<Component>(); foreach (Rhino.Geometry.BrepEdge be in surface.Value.Edges) { loop.outline.Add(be.ToNurbsCurve().ToGrevitCurve()); } slab.surface.profile.Add(loop); slab.parameters = parameters; slab.top = slopeTopPoint.ToGrevitPoint(); slab.bottom = slopeBottomPoint.ToGrevitPoint(); slab.slope = slope.Value; slab.GID = this.InstanceGuid.ToString(); DA.SetData("GrevitComponent", slab); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_String style = new GH_String(""); GH_String layer = new GH_String(""); GH_Point stop = new GH_Point(); GH_Point sbtm = new GH_Point(); List<Parameter> param = new List<Parameter>(); if (!DA.GetDataList<Parameter>("Parameters", param)) param = new List<Parameter>(); DA.GetData<GH_String>("Style", ref style); DA.GetData<GH_String>("Layer", ref layer); DA.GetData<GH_Point>("PointTop", ref stop); DA.GetData<GH_Point>("PointBottom", ref sbtm); Column s = new Column(style.Value,layer.Value,param,sbtm.ToGrevitPoint(),stop.ToGrevitPoint(),"",true ); SetGID(s); Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(sbtm.Value, 0.5); Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(new Rhino.Geometry.Point3d(stop.Value.X - sbtm.Value.X, stop.Value.Y - sbtm.Value.Y, stop.Value.Z - sbtm.Value.Z))); SetPreview(s.GID, srf.ToBrep()); DA.SetData("GrevitComponent", s); }
protected override void SolveInstance(IGH_DataAccess DA) { GH_Point curve = new GH_Point(); DA.GetData<GH_Point>("Point", ref curve); GH_String layer = new GH_String(string.Empty); DA.GetData<GH_String>("Layer", ref layer); DrawingPoint arc = new DrawingPoint(); arc.point = curve.ToGrevitPoint(); arc.TypeOrLayer = layer.Value; arc.GID = this.InstanceGuid.ToString(); DA.SetData("GrevitComponent", arc); }
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); }