Esempio n. 1
0
        protected override void SolveInstance(IGH_DataAccess da)
        {
            var ids   = da.GetDataList <int>(0);
            var types = da.GetDataList <string>(1);
            var facds = da.GetDataList <double>(2);
            var titls = da.GetDataList <string>(3);

            var load_cases = new List <GS_LoadCase>();

            for (int i = 0; i < ids.Count; ++i)
            {
                var id   = ids[i];
                var type = types.GetItemOrLast(i);
                var facd = facds.GetItemOrLast(i);
                var titl = titls.GetItemOrLast(i);

                if (string.IsNullOrEmpty(type))
                {
                    type = "NONE";
                }

                if (Math.Abs(facd) < 1.0E-6)
                {
                    facd = 0.0;
                }

                if (id <= 0)
                {
                    continue;
                }

                var lc = new LoadCase()
                {
                    Id    = id,
                    Type  = type,
                    Facd  = facd,
                    Title = titl
                };

                var gsLc = new GS_LoadCase()
                {
                    Value = lc,
                };

                load_cases.Add(gsLc);
            }

            da.SetDataList(0, load_cases);
        }
Esempio n. 2
0
 public override string ToString()
 {
     return("Line Load, LC = " + LoadCase.ToString());
 }