public void hydrate(Karamba.CrossSections.CroSec crosec) { id = (int)crosec.ind + 1; // Sofistik begins at 1 not 0 ids = crosec.elemIds; name = crosec.name; shape = crosec.shape(); if (shape == "V") { height = Math.Round((double)crosec.dims[0] * 1000, 3); upperWidth = Math.Round((double)crosec.dims[2] * 1000, 3); lowerWidth = Math.Round((double)crosec.dims[4] * 1000, 3); } else if (shape == "O") { diameter = Math.Round((double)crosec.dims[0] * 1000, 3); thickness = Math.Round((double)crosec.dims[1] * 1000, 3); } else if (shape == "[]") { height = Math.Round((double)crosec.dims[0] * 1000, 3); sWallThick = Math.Round((double)crosec.dims[1] * 1000, 3); upperWidth = Math.Round((double)crosec.dims[2] * 1000, 3); upperThick = Math.Round((double)crosec.dims[3] * 1000, 3); lowerWidth = Math.Round((double)crosec.dims[4] * 1000, 3); lowerThick = Math.Round((double)crosec.dims[5] * 1000, 3); filletRadius = Math.Round((double)crosec.dims[6] * 1000, 3); } else if (shape == "I") { height = Math.Round((double)crosec.dims[0] * 1000, 3); webThick = Math.Round((double)crosec.dims[1] * 1000, 3); upperWidth = Math.Round((double)crosec.dims[2] * 1000, 3); upperThick = Math.Round((double)crosec.dims[3] * 1000, 3); lowerWidth = Math.Round((double)crosec.dims[4] * 1000, 3); lowerThick = Math.Round((double)crosec.dims[5] * 1000, 3); filletRadius = Math.Round((double)crosec.dims[6] * 1000, 3); } }
public CrossSection(Karamba.CrossSections.CroSec crosec = null) { id = 1; ids = new List <string>(); shape = ""; name = ""; material = new Material(); diameter = thickness = height = upperWidth = lowerWidth = upperThick = lowerThick = sWallThick = webThick = filletRadius = 0; if (crosec != null) { hydrate(crosec); } }