private string[] LoadXmlVariables(XmlNode xml) { string[] ret = new string[23]; ret[0] = CustomSection.readAttribute(xml, "SectionName", "sec"); ret[1] = CustomSection.readAttribute(xml, "Shape", "G"); ret[4] = CustomSection.readAttribute(xml, "t3", "0"); ret[5] = CustomSection.readAttribute(xml, "t2", "0"); ret[6] = CustomSection.readAttribute(xml, "tf", "0"); ret[7] = CustomSection.readAttribute(xml, "tw", "0"); ret[8] = CustomSection.readAttribute(xml, "t2b", "0"); ret[9] = CustomSection.readAttribute(xml, "tfb", "0"); ret[10] = CustomSection.readAttribute(xml, "dis", "0"); ret[11] = CustomSection.readAttribute(xml, "Area", "0"); ret[12] = CustomSection.readAttribute(xml, "TorsConst", "0"); ret[13] = CustomSection.readAttribute(xml, "I33", "0"); ret[14] = CustomSection.readAttribute(xml, "I22", "0"); ret[15] = CustomSection.readAttribute(xml, "AS2", "0"); ret[16] = CustomSection.readAttribute(xml, "AS3", "0"); ret[17] = CustomSection.readAttribute(xml, "S33", "0"); ret[18] = CustomSection.readAttribute(xml, "S22", "0"); ret[19] = CustomSection.readAttribute(xml, "Z33", "0"); ret[20] = CustomSection.readAttribute(xml, "Z22", "0"); ret[21] = CustomSection.readAttribute(xml, "R33", "0"); ret[22] = CustomSection.readAttribute(xml, "R22", "0"); return(ret); }
public void LoadXmlSections(string filePath, Catalog <Section> cat) { try { XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlNode sections = doc.SelectSingleNode("//Frame_Section_Properties_01_-_General"); if (sections != null) { XmlNodeList instances = sections.SelectNodes("SectionName"); List <string> knownTemplates = new List <string>(new string[] { "Double Angle", "Channel", "I/Wide Flange", "Box/Tube", "Pipe", "Angle", "Tee" }); if (instances != null && instances.Count > 0) { foreach (XmlNode node in instances) { string temp = CustomSection.readAttribute(node, "Shape", ""); Section sec = null; if (knownTemplates.Contains(temp)) { sec = NewSection(Material.MaterialManager.Instance.DefaultSteel, null, LoadXmlVariables(node)); } else { sec = new CustomSection(node); } if (sec != null) { cat[sec.Name] = sec; } } } } Canguro.Model.Serializer.Deserializer deserializer = new Canguro.Model.Serializer.Deserializer(Model.Instance); XmlNode beams = doc.SelectSingleNode("//Frame_Section_Properties_03_-_Concrete_Beam"); if (beams != null) { deserializer.readFrameConcreteBeams(beams, cat); } XmlNode columns = doc.SelectSingleNode("//Frame_Section_Properties_02_-_Concrete_Column"); if (columns != null) { deserializer.readFrameConcreteColumns(columns, cat); } } catch { MessageBox.Show(Culture.Get("WrongXsecFile") + ": " + filePath, Culture.Get("error"), MessageBoxButtons.OK, MessageBoxIcon.Error); } }