/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static LoadCombination ToLoadCombination( this IFBasicCombination lusasLoadCombination, Dictionary <string, Loadcase> loadcases) { object[] loadcaseIDs = lusasLoadCombination.getLoadcaseIDs(); object[] loadcaseFactors = lusasLoadCombination.getFactors(); List <Tuple <double, ICase> > factoredLoadcases = new List <Tuple <double, ICase> >(); Loadcase loadcase = null; for (int i = 0; i < loadcaseIDs.Count(); i++) { int loadcaseID = (int)loadcaseIDs[i]; double loadcaseFactor = (double)loadcaseFactors[i]; loadcases.TryGetValue(loadcaseID.ToString(), out loadcase); Tuple <double, ICase> factoredLoadcase = new Tuple <double, ICase>(loadcaseFactor, loadcase); factoredLoadcases.Add(factoredLoadcase); } LoadCombination loadCombination = new LoadCombination { Name = GetName(lusasLoadCombination), Number = lusasLoadCombination.getID(), LoadCases = factoredLoadcases }; int adapterNameId = lusasLoadCombination.getID(); loadCombination.SetAdapterId(typeof(LusasId), adapterNameId); return(loadCombination); }
/***************************************************/ internal static int GetAdapterID(IFBasicCombination lusasLoadCombination, char lastCharacter) { int adapterID = 0; lusasLoadCombination.getName(); if (lusasLoadCombination.getName().Contains("/")) { adapterID = int.Parse(lusasLoadCombination.getName().Split(lastCharacter, '/')[1]); } else { adapterID = lusasLoadCombination.getID(); } return(adapterID); }