Exemplo n.º 1
0
 public static Dictionary <string, object> LoadCombinationDeconstruct(FemDesign.Loads.LoadCombination loadCombination)
 {
     return(new Dictionary <string, object>
     {
         { "Guid", loadCombination.Guid },
         { "Name", loadCombination.Name },
         { "Type", loadCombination.Type.ToString() },
         { "LoadCases", loadCombination.GetLoadCaseGuidsAsString() },
         { "Gammas", loadCombination.GetGammas() }
     });
 }
Exemplo n.º 2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            FemDesign.Loads.LoadCombination obj = null;
            if (!DA.GetData(0, ref obj))
            {
                return;
            }
            if (obj == null)
            {
                return;
            }

            // return
            DA.SetData(0, obj.Guid);
            DA.SetData(1, obj.Name);
            DA.SetData(2, obj.Type.ToString());
            DA.SetDataList(3, obj.GetLoadCaseGuidsAsString());
            DA.SetDataList(4, obj.GetGammas());
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            FemDesign.Loads.LoadCombination obj = null;
            if (!DA.GetData(0, ref obj))
            {
                return;
            }
            if (obj == null)
            {
                return;
            }

            // The following code is to convert 'item' to 'list object'
            // It is required to construct the Load Combination without graftening the data

            var guidList = new List <object> {
                obj.Guid
            };

            var nameList = new List <object> {
                obj.Name
            };

            var objectTypeList = new List <object> {
                obj.Type.ToString()
            };


            // return
            DA.SetDataList(0, guidList);
            DA.SetDataList(1, nameList);
            DA.SetDataList(2, objectTypeList);
            DA.SetDataList(3, obj.GetLoadCaseGuidsAsString());
            DA.SetDataList(4, obj.GetGammas());
        }
Exemplo n.º 4
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            FemDesign.Loads.LoadCombination loadCombination = null;
            int  impfRqd    = 0;
            int  stabRqd    = 0;
            bool nle        = false;
            bool pl         = false;
            bool nls        = false;
            bool cr         = false;
            bool f2nd       = false;
            bool im         = false;
            int  waterlevel = 0;

            if (!DA.GetData(0, ref loadCombination))
            {
                return;
            }
            if (!DA.GetData(1, ref impfRqd))
            {
                // pass
            }
            if (!DA.GetData(2, ref stabRqd))
            {
                // pass
            }
            if (!DA.GetData(3, ref nle))
            {
                // pass
            }
            if (!DA.GetData(4, ref pl))
            {
                // pass
            }
            if (!DA.GetData(5, ref nls))
            {
                // pass
            }
            if (!DA.GetData(6, ref cr))
            {
                // pass
            }
            if (!DA.GetData(7, ref f2nd))
            {
                // pass
            }
            if (!DA.GetData(8, ref im))
            {
                // pass
            }
            if (!DA.GetData(9, ref waterlevel))
            {
                // pass
            }
            if (loadCombination == null)
            {
                return;
            }

            //
            var clone = loadCombination.DeepClone();

            clone.CombItem = new FemDesign.Calculate.CombItem(impfRqd, stabRqd, nle, pl, nls, cr, f2nd, im, waterlevel);

            // return
            DA.SetData(0, clone);
        }