/// <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) { #region variables string MaterialName = "N/A"; // for glulam according LIMTREBOKA double fmgk = new double(); double ft0gk = new double(); double ft90gk = new double(); double fvgk = new double(); double frgk = new double(); double E0gmean = new double(); double E0g05 = new double(); double E90gmean = new double(); double E90g05 = new double(); double Ggmean = new double(); double Gg05 = new double(); double Gtgmean = new double(); double Grg05 = new double(); double Qgk = new double(); double Qgmean = new double(); #endregion GH_Structure <GH_String> Tree = new GH_Structure <GH_String>(); List <string> nlist = new List <string>(); #region input DA.GetData(0, ref MaterialName); DA.GetDataTree(1, out Tree); #endregion #region sorting for (int k = 0; k < Tree.get_Branch(0).Count; k++) { GH_Path pth = new GH_Path(k); if (MaterialName == Tree.get_Branch(0)[k].ToString()) { //B = Tree.get_Branch(0)[k]; for (int kk = 1; kk < Tree.Branches.Count(); kk++) { nlist.Add(Tree.get_Branch(kk)[k].ToString()); } } } #endregion double.Parse(nlist[0]); fmgk = double.Parse(nlist[0]); ft0gk = double.Parse(nlist[0]); ft90gk = double.Parse(nlist[0]); fvgk = double.Parse(nlist[0]); frgk = double.Parse(nlist[0]); E0gmean = double.Parse(nlist[0]); E0g05 = double.Parse(nlist[0]); E90gmean = double.Parse(nlist[0]); E90g05 = double.Parse(nlist[0]); Ggmean = double.Parse(nlist[0]); Gg05 = double.Parse(nlist[0]); Gtgmean = double.Parse(nlist[0]); Grg05 = double.Parse(nlist[0]); Qgk = double.Parse(nlist[0]); Qgmean = double.Parse(nlist[0]); #region solve Material_properties Material_prop = new Material_properties( MaterialName, fmgk, ft0gk, ft90gk, fvgk, frgk, E0gmean, E0g05, E90gmean, E90g05, Ggmean, Gg05, Gtgmean, Grg05, Qgk, Qgmean ); #endregion #region output DA.SetData(0, Material_prop); DA.SetDataList(1, nlist); #endregion }
public Material(string _materialName, int _materialId, Material_properties _properties) { materialName = _materialName; // inheriting Class materialId = -999; // inheriting Class properties = _properties; }
/// <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) { #region variables string MaterialName = "N/A"; // for glulam according LIMTREBOKA double fmgk = new double(); double ft0gk = new double(); double ft90gk = new double(); double fvgk = new double(); double frgk = new double(); double E0gmean = new double(); double E0g05 = new double(); double E90gmean = new double(); double E90g05 = new double(); double Ggmean = new double(); double Gg05 = new double(); double Gtgmean = new double(); double Grg05 = new double(); double Qgk = new double(); double Qgmean = new double(); #endregion #region input DA.GetData(0, ref MaterialName); if (!DA.GetData(1, ref fmgk)) { return; } if (!DA.GetData(2, ref ft0gk)) { return; } if (!DA.GetData(3, ref ft90gk)) { return; } if (!DA.GetData(4, ref fvgk)) { return; } if (!DA.GetData(5, ref frgk)) { return; } if (!DA.GetData(6, ref E0gmean)) { return; } if (!DA.GetData(7, ref E0g05)) { return; } if (!DA.GetData(8, ref E90gmean)) { return; } if (!DA.GetData(9, ref E90g05)) { return; } if (!DA.GetData(10, ref Ggmean)) { return; } if (!DA.GetData(11, ref Gg05)) { return; } if (!DA.GetData(12, ref Gtgmean)) { return; } if (!DA.GetData(1, ref Grg05)) { return; } if (!DA.GetData(1, ref Qgk)) { return; } if (!DA.GetData(1, ref Qgmean)) { return; } #endregion #region solve Material_properties Material_prop = new Material_properties( MaterialName, fmgk, ft0gk, ft90gk, fvgk, frgk, E0gmean, E0g05, E90gmean, E90g05, Ggmean, Gg05, Gtgmean, Grg05, Qgk, Qgmean ); #endregion #region output DA.SetData(0, Material_prop); #endregion }