Example #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Curve crv = null;

            if (!DA.GetData("Curve", ref crv))
            {
                return;
            }

            crv.Domain.MakeIncreasing();

            List <object> r_orientation = new List <object>();

            DA.GetDataList("Orientation", r_orientation);

            object r_data = null;

            DA.GetData("Data", ref r_data);

            CrossSectionOrientation orientation = ParseGlulamOrientation(r_orientation, crv);

            AddRuntimeMessage(GH_RuntimeMessageLevel.Remark, orientation.ToString());

            GlulamData data = ParseGlulamData(r_data);

            AddRuntimeMessage(GH_RuntimeMessageLevel.Remark, data.ToString());

            data.Samples = (int)Math.Ceiling(crv.GetLength() / GlulamData.DefaultSampleDistance);

            Glulam glulam = Glulam.CreateGlulam(crv, orientation, data);


            DA.SetData("Glulam", new GH_Glulam(glulam));
        }