/***************************************************/ private ISectionProperty GetSectionProperty(int crossSectionNumber) { ISectionProperty sectionProperty; if (!m_sectionDict.TryGetValue(crossSectionNumber, out sectionProperty)) { rf.ICrossSection rfISection = modelData.GetCrossSection(crossSectionNumber, rf.ItemAt.AtNo); rf.CrossSection rfSection = rfISection.GetData(); rf.Material rfMat = modelData.GetMaterial(rfSection.MaterialNo, rf.ItemAt.AtNo).GetData(); sectionProperty = rfISection.FromRFEM(rfMat); m_sectionDict.Add(crossSectionNumber, sectionProperty); } return(sectionProperty); }
/***************************************************/ /**** Private methods ****/ /***************************************************/ //The List<string> in the methods below can be changed to a list of any type of identification more suitable for the toolkit //If no ids are provided, the convention is to return all elements of the type private List <ISectionProperty> ReadSectionProperties(List <string> ids = null) { List <ISectionProperty> sectionPropList = new List <ISectionProperty>(); //ReadSectionFromRFEMLibrary("IPE 200"); if (ids == null) { foreach (rf.CrossSection rfSection in modelData.GetCrossSections()) { rf.Material rfMaterial = modelData.GetMaterial(rfSection.MaterialNo, rf.ItemAt.AtNo).GetData(); rf.ICrossSection rfISection = modelData.GetCrossSection(rfSection.No, rf.ItemAt.AtNo); ISectionProperty section = rfISection.FromRFEM(rfMaterial); sectionPropList.Add(section); int sectionId = rfSection.No; if (!m_sectionDict.ContainsKey(sectionId)) { m_sectionDict.Add(sectionId, section); } } } else { foreach (string id in ids) { rf.ICrossSection rfISection = modelData.GetCrossSection(Int32.Parse(id), rf.ItemAt.AtNo); rf.CrossSection rfSection = rfISection.GetData(); rf.Material rfMaterial = modelData.GetMaterial(rfSection.MaterialNo, rf.ItemAt.AtNo).GetData(); sectionPropList.Add(rfISection.FromRFEM(rfMaterial)); } } return(sectionPropList); }