protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get indata
            FemDesign.Model model = null;
            if (!DA.GetData("FdModel", ref model))
            {
                // pass
            }

            List <FemDesign.GenericClasses.IStructureElement> elements = new List <FemDesign.GenericClasses.IStructureElement>();

            DA.GetDataList("Structure Elements", elements);

            List <FemDesign.GenericClasses.ILoadElement> loads = new List <FemDesign.GenericClasses.ILoadElement>();

            DA.GetDataList("Loads", loads);

            List <FemDesign.Loads.LoadCase> loadCases = new List <FemDesign.Loads.LoadCase>();

            DA.GetDataList("LoadCases", loadCases);

            List <FemDesign.Loads.LoadCombination> loadCombinations = new List <FemDesign.Loads.LoadCombination>();

            DA.GetDataList("LoadCombinations", loadCombinations);

            List <FemDesign.Loads.ModelGeneralLoadGroup> loadGroups = new List <FemDesign.Loads.ModelGeneralLoadGroup>();

            DA.GetDataList("LoadGroups", loadGroups);

            bool overwrite = false;

            DA.GetData("Overwrite", ref overwrite);

            var clone = model.DeepClone();

            clone.AddElements(elements, overwrite);
            clone.AddLoads(loads, overwrite);
            clone.AddLoadCases(loadCases, overwrite);
            clone.AddLoadCombinations(loadCombinations, overwrite);
            clone.AddLoadGroupTable(loadGroups, overwrite);


            DA.SetData("FdModel", clone);
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get indata
            FemDesign.Model model = null;
            DA.GetData("FdModel", ref model);

            List <FemDesign.Bars.Bar> bars = new List <FemDesign.Bars.Bar>();

            DA.GetDataList("Bars", bars);

            List <FemDesign.ModellingTools.FictitiousBar> fictBars = new List <FemDesign.ModellingTools.FictitiousBar>();

            DA.GetDataList("FictitiousBars", fictBars);

            List <FemDesign.Shells.Slab> slabs = new List <FemDesign.Shells.Slab>();

            DA.GetDataList("Shells", slabs);

            List <FemDesign.ModellingTools.FictitiousShell> fictShells = new List <FemDesign.ModellingTools.FictitiousShell>();

            DA.GetDataList("FictitiousShells", fictShells);

            List <FemDesign.Shells.Panel> panels = new List <Shells.Panel>();

            DA.GetDataList("Panels", panels);

            List <FemDesign.Cover> covers = new List <FemDesign.Cover>();

            DA.GetDataList("Covers", covers);

            List <FemDesign.GenericClasses.ILoadElement> loads = new List <FemDesign.GenericClasses.ILoadElement>();

            DA.GetDataList("Loads", loads);

            List <FemDesign.Loads.LoadCase> loadCases = new List <FemDesign.Loads.LoadCase>();

            DA.GetDataList("LoadCases", loadCases);

            List <FemDesign.Loads.LoadCombination> loadCombinations = new List <FemDesign.Loads.LoadCombination>();

            DA.GetDataList("LoadCombinations", loadCombinations);

            List <FemDesign.Loads.ModelGeneralLoadGroup> loadGroups = new List <FemDesign.Loads.ModelGeneralLoadGroup>();

            DA.GetDataList("LoadGroups", loadGroups);

            List <FemDesign.GenericClasses.ISupportElement> supports = new List <FemDesign.GenericClasses.ISupportElement>();

            DA.GetDataList("Supports", supports);

            List <FemDesign.StructureGrid.Storey> storeys = new List <StructureGrid.Storey>();

            DA.GetDataList("Storeys", storeys);

            List <FemDesign.StructureGrid.Axis> axes = new List <StructureGrid.Axis>();

            DA.GetDataList("Axes", axes);

            bool overwrite = false;

            DA.GetData("Overwrite", ref overwrite);


            // Ensure that the component recieves the load cases that are included in the load groups
            bool loadCasesProvided = true;

            if (loadGroups.Any())
            {
                foreach (Loads.ModelGeneralLoadGroup loadGroup in loadGroups)
                {
                    loadCasesProvided = loadGroup.GetLoadCases().All(i => loadCases.Contains(i));
                    if (!loadCasesProvided)
                    {
                        this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Must provide all load cases used in load groups");
                        return;
                    }
                }
            }

            // cast ILoads
            List <object> _loads = loads.Cast <object>().ToList();

            // clone model
            var clone = model.DeepClone();

            clone.AddEntities(bars, fictBars, slabs, fictShells, panels, covers, _loads, loadCases, loadCombinations, supports, storeys, axes, loadGroups, overwrite);

            DA.SetData("FdModel", clone);
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get indata
            FemDesign.Model model = null;
            if (!DA.GetData(0, ref model))
            {
                // pass
            }

            List<FemDesign.Bars.Bar> bars = new List<FemDesign.Bars.Bar>();
            if (!DA.GetDataList(1, bars))
            {
                // pass
            }

            List<FemDesign.ModellingTools.FictitiousBar> fictBars = new List<FemDesign.ModellingTools.FictitiousBar>();
            if (!DA.GetDataList(2, fictBars))
            {
                // pass
            }

            List<FemDesign.Shells.Slab> slabs = new List<FemDesign.Shells.Slab>();
            if (!DA.GetDataList(3, slabs))
            {
                // pass
            }

            List<FemDesign.ModellingTools.FictitiousShell> fictShells = new List<FemDesign.ModellingTools.FictitiousShell>();
            if (!DA.GetDataList(4, fictShells))
            {
                // pass
            }

            List<FemDesign.Shells.Panel> panels = new List<Shells.Panel>();
            {
                if (!DA.GetDataList(5, panels))
                {
                    // pass
                }
            }

            List<FemDesign.Cover> covers = new List<FemDesign.Cover>();
            if (!DA.GetDataList(6, covers))
            {
                // pass
            }

            List<FemDesign.GenericClasses.ILoadElement> loads = new List<FemDesign.GenericClasses.ILoadElement>();
            if (!DA.GetDataList(7, loads))
            {
                // pass
            }

            List<FemDesign.Loads.LoadCase> loadCases = new List<FemDesign.Loads.LoadCase>();
            if (!DA.GetDataList(8, loadCases))
            {
                // pass
            }

            List<FemDesign.Loads.LoadCombination> loadCombinations = new List<FemDesign.Loads.LoadCombination>();
            if (!DA.GetDataList(9, loadCombinations))
            {
                // pass
            }

            List<FemDesign.GenericClasses.ISupportElement> supports = new List<FemDesign.GenericClasses.ISupportElement>();
            if (!DA.GetDataList(10, supports))
            {
                // pass
            }

            List<FemDesign.StructureGrid.Storey> storeys = new List<StructureGrid.Storey>();
            if (!DA.GetDataList(11, storeys))
            {
                // pass
            }

            List<FemDesign.StructureGrid.Axis> axes = new List<StructureGrid.Axis>();
            if (!DA.GetDataList(12, axes))
            {
                // pass
            }

            bool overwrite = false;
            if (!DA.GetData(13, ref overwrite))
            {
                // pass
            }

            // cast ILoads
            List<object> _loads = loads.Cast<object>().ToList();

            // clone model
            var clone = model.DeepClone();

            clone.AddEntities(bars, fictBars, slabs, fictShells, panels, covers, _loads, loadCases, loadCombinations, supports, storeys, axes, null, overwrite);

            DA.SetData(0, clone);
        }