コード例 #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object can be used to retrieve data from input parameters and
        /// to store data in output parameters.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //inputs
            List <Line>   lines   = new List <Line>();
            List <string> sects   = new List <string>();
            List <string> mats    = new List <string>();
            List <Curve>  crvsecs = new List <Curve>();

            DA.GetDataList(0, lines);
            DA.GetDataList(1, sects);
            DA.GetDataList(2, mats);
            DA.GetDataList(3, crvsecs);

            //parameters
            List <Column> cols  = new List <Column>();
            List <string> infos = new List <string>();

            int nlines = lines.Count;
            int nsects = sects.Count;

            infos.Add("number of line=" + nlines + "number of sections=" + nsects);

            if (nlines != nsects)
            {
                infos.Add("number of lines and sections have to be the same");
                var ma = new GH_RuntimeMessage("The lines and description number is not the same, check it out", GH_RuntimeMessageLevel.Error, null);
            }
            else
            {
                infos.Add("The process of creating columns started");
                for (int i = 0; i < nlines; i++)
                {
                    var col = new Column(-1, lines[i]);
                    col.name = "straight column";
                    cols.Add(col);

                    //infos.Add("column number=" + i + " type=" + col.name);
                    //infos.Add("column id=" + col.id + " material=" + col.material);
                }
            }

            DA.SetDataList(0, cols);
            DA.SetDataList(1, infos);
        }
コード例 #2
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //inputs
            List <Surface> srfs  = new List <Surface>();
            List <string>  sects = new List <string>();
            List <string>  mats  = new List <string>();

            DA.GetDataList(0, srfs);
            DA.GetDataList(1, sects);
            DA.GetDataList(2, mats);

            //parameters
            List <Wall>   wls   = new List <Wall>();
            List <string> infos = new List <string>();

            int nwls   = srfs.Count;
            int nsects = sects.Count;

            infos.Add("number of surfaces=" + nwls + "number of sections=" + nsects);

            if (nwls != nsects)
            {
                infos.Add("number of surfaces and sections have to be the same");
                var ma = new GH_RuntimeMessage("The lines and description number is not the same, check it out", GH_RuntimeMessageLevel.Error, null);
            }
            else
            {
                infos.Add("The process of creating walls started");
                for (int i = 0; i < nwls; i++)
                {
                }
            }

            DA.SetDataList(0, wls);
            DA.SetDataList(1, infos);
        }