Beispiel #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() }
     });
 }
Beispiel #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());
        }