public override int ApplyDesignedCrossSections(object frameSetFilter, int index = 0) { int count = 0; if (frameSetFilter is eSteelFrameSetType) { eSteelFrameSetType type = (eSteelFrameSetType)frameSetFilter; count = this.applyDesignedCrossSections(type, index); } else if (frameSetFilter is string) { foreach (IFrameSet fs in this.frameSets.Where(f => f.frameSetName.Equals((string)frameSetFilter))) { if (fs.designedCrossSections != null && fs.designedCrossSections.Count > 0) { fs.crossSection = null; if (index > fs.designedCrossSections.Count - 1) { index = fs.designedCrossSections.Count - 1; } fs.crossSection = fs.designedCrossSections[index].DuplicatesCrosssection(); fs.UpdatesFrameCrossSections(); count++; } } } return(count); }
//more functions private void toggleMinuteDensityStatus(eSteelFrameSetType type, bool toggle) { foreach (sSteelFrameSet fs in this.frameSets.Cast <sSteelFrameSet>().Where(f => f.frameStructureType == type)) { fs.AsMinuteDensity = toggle; } }
public void DesignSteelBeams_Gravity(bool isComposite, eSteelFrameSetType beamType, ISystem sysLRFD_Full, ref ISystem sysLRFD_BeamMinute, ISystem sysLIVE, out double maxDepth_Designed, int count = 3, double depthLimitMax_in = -1.0, double depthLimitMin_in = -1.0) { List <sCrossSection> wShapes = sCrossSection.GetAllWShapes().OrderBy(c => c.weight).ThenBy(c => c.depth).ToList(); IKodeBeamDesigner beamDesign = null; if (isComposite) { beamDesign = new sKodeSteelCompositeBeamDesigner(); } else { beamDesign = new sKodeSteelBeamDesigner(); } try { var beamDesignGroup = sysLRFD_BeamMinute.frameSets.Cast <sSteelFrameSet>().Where(f => f.frameStructureType == beamType).GroupBy(f => f.GetFrameSetDemand(eColorMode.Moment_Y, 0)); // //this should be per bay??????????????????? double maxDepth = 0.0; // // foreach (var bg in beamDesignGroup) { sSteelFrameSet f_LRFD_beamMinute = bg.ElementAt(0); sSteelFrameSet f_LRFD_Full = sysLRFD_Full.GetsFrameSetByGUID(f_LRFD_beamMinute.objectGUID) as sSteelFrameSet; sSteelFrameSet f_Live = sysLIVE.GetsFrameSetByGUID(f_LRFD_beamMinute.objectGUID) as sSteelFrameSet; List <sCrossSection> designedSections = beamDesign.Design_Beams_Gravity(f_LRFD_Full, f_LRFD_beamMinute, f_Live, wShapes, count, depthLimitMax_in, depthLimitMin_in); if (designedSections != null && designedSections.Count > 0) { foreach (sSteelFrameSet b in bg) { b.designedCrossSections = new List <sCrossSection>(); foreach (sCrossSection cs in designedSections) { b.designedCrossSections.Add(cs.DuplicatesCrosssection()); } } foreach (sCrossSection cs in designedSections) { if (cs.depth > maxDepth) { maxDepth = cs.depth; } } } } maxDepth_Designed = maxDepth; } catch { throw new NotImplementedException("Use Steel System"); } }
public override void ToggleMinuteDensityStatus(object frameSetFilter, bool toggle) { if (frameSetFilter is string) { foreach (IFrameSet fs in this.frameSets.Where(f => f.frameSetName.Equals((string)frameSetFilter))) { fs.AsMinuteDensity = toggle; } } else if (frameSetFilter is eSteelFrameSetType) { eSteelFrameSetType type = (eSteelFrameSetType)frameSetFilter; this.toggleMinuteDensityStatus(type, toggle); } }
private int applyDesignedCrossSections(eSteelFrameSetType type, int index = 0) { int count = 0; foreach (sSteelFrameSet fs in this.frameSets.Cast <sSteelFrameSet>().Where(f => f.frameStructureType == type)) { if (fs.designedCrossSections != null && fs.designedCrossSections.Count > 0) { fs.crossSection = null; if (index > fs.designedCrossSections.Count - 1) { index = fs.designedCrossSections.Count - 1; } fs.crossSection = fs.designedCrossSections[index].DuplicatesCrosssection(); fs.UpdatesFrameCrossSections(); count++; } } return(count); }