private void readFrameSection(XmlNode node, Catalog<Section.Section> cat)
{
string name = readAttribute(node, "SectionName", "");
string mat = readAttribute(node, "Material", "");
string shape = readAttribute(node, "Shape", "General");
float t3 = float.Parse(readAttribute(node, "t3", "0"));
float t2 = float.Parse(readAttribute(node, "t2", "0"));
float tf = float.Parse(readAttribute(node, "tf", "0"));
float tw = float.Parse(readAttribute(node, "tw", "0"));
float t2b = float.Parse(readAttribute(node, "t2b", "0"));
float tfb = float.Parse(readAttribute(node, "tfb", "0"));
float dis = float.Parse(readAttribute(node, "dis", "0"));
float a = float.Parse(readAttribute(node, "Area", "0"));
float j = float.Parse(readAttribute(node, "TorsConst", "0"));
float I33 = float.Parse(readAttribute(node, "I33", "0"));
float I22 = float.Parse(readAttribute(node, "I22", "0"));
float AS2 = float.Parse(readAttribute(node, "AS2", "0"));
float AS3 = float.Parse(readAttribute(node, "AS3", "0"));
float S33 = float.Parse(readAttribute(node, "S33", "0"));
float S22 = float.Parse(readAttribute(node, "S22", "0"));
float Z33 = float.Parse(readAttribute(node, "Z33", "0"));
float Z22 = float.Parse(readAttribute(node, "Z22", "0"));
float R33 = float.Parse(readAttribute(node, "R33", "0"));
float R22 = float.Parse(readAttribute(node, "R22", "0"));
FrameSection sec = cat[name] as FrameSection;
Material.Material material = MaterialManager.Instance.Materials[mat];
if (material == null)
material = MaterialManager.Instance.DefaultSteel;
if (material != null)
{
if (sec != null)
{
sec.Area = a;
sec.As2 = AS2;
sec.As3 = AS3;
sec.Dis = dis;
sec.I22 = I22;
sec.I33 = I33;
sec.Material = material;
sec.R22 = R22;
sec.R33 = R33;
sec.S22 = S22;
sec.S33 = S33;
sec.T2 = t2;
sec.T2b = t2b;
sec.T3 = t3;
sec.Tf = tf;
sec.Tfb = tfb;
sec.TorsConst = j;
sec.Tw = tw;
sec.Z22 = Z22;
sec.Z33 = Z33;
}
else
{
model.Sections[name] = null;
switch (shape)
{
case "Double Angle":
model.Sections[name] = new Section.DoubleAngle(name, "2L", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Channel":
model.Sections[name] = new Section.Channel(name, "C", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "I/Wide Flange":
model.Sections[name] = new Section.IWideFlange(name, "I", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Box/Tube":
model.Sections[name] = new Section.BoxTube(name, "B", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Pipe":
model.Sections[name] = new Section.Pipe(name, "P", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Angle":
model.Sections[name] = new Section.Angle(name, "L", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Tee":
model.Sections[name] = new Section.Tee(name, "T", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Circle":
model.Sections[name] = new Section.Circle(name, "RN", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
case "Rectangular":
model.Sections[name] = new Section.Rectangular(name, "R", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
default:
model.Sections[name] = new Section.General(name, "G", material, null, t3, t2, tf, tw, t2b, tfb, dis, a, j, I33, I22, AS2, AS3, S33, S22, Z33, Z22, R33, R22);
break;
}
}
}
}