/// <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)
        {
            SpiralPart       prt1        = new SpiralPart();   //第一段
            PlatFormPart     prt2        = new PlatFormPart(); //第二段
            SpiralPart       prt3        = new SpiralPart();   //第三段
            PlatFormPart     prt4        = new PlatFormPart(); //第四段
            SpiralPart       prt5        = new SpiralPart();   //第五段
            List <StairBase> StairGroups = new List <StairBase> {
                prt1, prt2, prt3, prt4, prt5
            };

            List <Curve> crvs  = new List <Curve>();
            List <Line>  steps = new List <Line>();

            for (int i = 0; i < StairGroups.Count; i++)
            {
                if (i > 0)
                {
                    StairGroups[i].StartPst = StairGroups[i - 1].EndPst;
                }
                StairGroups[i].SetEndPst();
                StairGroups[i].GenerateGeom();
                StairMember mi = StairGroups[i].StairMembers;
                crvs.Add(mi.InnerCurve);
                crvs.Add(mi.OutCurve);
                if (StairGroups[i].GetType() == typeof(SpiralPart))
                {
                    steps.AddRange(mi.StepAxis);
                }
            }
            DA.SetDataList(0, crvs);
            DA.SetDataList(1, steps);
        }
Ejemplo n.º 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)
        {
            List <StairBase> StairGroups = new List <StairBase>();

            DA.GetDataList(0, StairGroups);
            List <Curve>    crvs      = new List <Curve>();
            List <Line>     steps     = new List <Line>();
            List <Polyline> beamLines = new List <Polyline>();

            for (int i = 0; i < StairGroups.Count; i++)
            {
                StairGroups[i].GenerateGeom();
                StairMember mi = StairGroups[i].StairMembers;
                crvs.Add(mi.InnerCurve);
                crvs.Add(mi.OutCurve);
                if (StairGroups[i].GetType() == typeof(SpiralPart))
                {
                    steps.AddRange(mi.StepAxis);
                }
                beamLines.Add(mi.InnerAxis);
                beamLines.Add(mi.OutAxis);
            }
            DA.SetDataList(1, beamLines);
            DA.SetDataList(2, steps);
        }