Exemplo n.º 1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            object raw_g = null;

            if (!DA.GetData("Glulam", ref raw_g))
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Invalid Glulam input.");
                return;
            }

            GH_Glulam ghg = raw_g as GH_Glulam;

            if (ghg == null)
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Invalid Glulam input.");
                return;
            }

            Glulam g = ghg.Value;

            double offset = 0.0;

            DA.GetData("Amount", ref offset);

            DA.SetData("Output", g.GetBoundingBrep(offset));
        }
Exemplo n.º 2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            object raw_in = null;

            if (!DA.GetData("Glulam", ref raw_in))
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "No Glulam specified.");
                return;
            }
            GH_Glulam ghg = raw_in as GH.GH_Glulam;

            if (ghg == null)
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Input is not valid Glulam object.");
                return;
            }
            Glulam g = ghg.Value;

            int side = 0;

            DA.GetData("Side", ref side);
            double offset = 0.0;

            DA.GetData("Offset", ref offset);
            double width = 0.0;

            DA.GetData("Width", ref width);
            double extension = 0.0;

            DA.GetData("Extension", ref extension);

            Brep b = g.GetSideSurface(side, offset, width, extension);

            DA.SetData("Brep", b);
        }