// // (C) Copyright 2003-2013 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // using System; using System.Collections.Generic; using System.Linq; using System.Text; using Autodesk.Revit.DB; using Autodesk.Revit.DB.CodeChecking.Engineering; using Autodesk.CodeChecking.Concrete; using CodeCheckingConcreteExample.Engine; using CodeCheckingConcreteExample.Concrete; using CodeCheckingConcreteExample.Utility; namespace CodeCheckingConcreteExample.Main.Calculation { /// /// Represents user's section of linear element. /// class LinearSection : SectionDataBase { /// /// Initializes a new instance of user's section object of linear element. /// /// Instance of base section object with predefined parameters to copy. public LinearSection(SectionDataBase sectionDataBase) : base(sectionDataBase) { DesignWarning = new List(); DesignInfo = new List(); DesignError = new List(); } /// /// Gets analitical results for RC bar section /// /// Analitical results in the section. public ResultInPointLinear GetCalcResultsInPoint() { ResultInPointLinear resultInPoint = null; if (ListInternalForces != null && ListInternalForces.Count > 0) { resultInPoint = new ResultInPointLinear(); resultInPoint[ResultTypeLinear.X] = (CalcPoint as CalcPointLinear).CoordAbsolute; resultInPoint[ResultTypeLinear.X_Rel] = (CalcPoint as CalcPointLinear).CoordRelative; IEnumerable vmx = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.MomentMx; resultInPoint[ResultTypeLinear.MxMax] = vmx.Max(); resultInPoint[ResultTypeLinear.MxMin] = vmx.Min(); IEnumerable vmy = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.MomentMy; resultInPoint[ResultTypeLinear.MyMax] = vmy.Max(); resultInPoint[ResultTypeLinear.MyMin] = vmy.Min(); IEnumerable vmz = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.MomentMz; resultInPoint[ResultTypeLinear.MzMax] = vmz.Max(); resultInPoint[ResultTypeLinear.MzMin] = vmz.Min(); IEnumerable vfx = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.ForceFx; resultInPoint[ResultTypeLinear.FxMax] = vfx.Max(); resultInPoint[ResultTypeLinear.FxMin] = vfx.Min(); IEnumerable vfy = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.ForceFy; resultInPoint[ResultTypeLinear.FyMax] = vfy.Max(); resultInPoint[ResultTypeLinear.FyMin] = vfy.Min(); IEnumerable vfz = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.ForceFz; resultInPoint[ResultTypeLinear.FzMax] = vfz.Max(); resultInPoint[ResultTypeLinear.FzMin] = vfz.Min(); resultInPoint[ResultTypeLinear.Abottom] = AsBottom; resultInPoint[ResultTypeLinear.Atop] = AsTop; resultInPoint[ResultTypeLinear.Aleft] = AsLeft; resultInPoint[ResultTypeLinear.Aright] = AsRight; resultInPoint[ResultTypeLinear.StirrupsSpacing] = System.Math.Min(Spacing, 10.0); resultInPoint[ResultTypeLinear.TransversalReinforcemenDensity] = TransversalDensity; IEnumerable vuz = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.DeflectionUz; resultInPoint[ResultTypeLinear.UzMax] = vuz.Max(); resultInPoint[ResultTypeLinear.UzMin] = vuz.Min(); resultInPoint[ResultTypeLinear.UzRealMax] = StiffnesCoeff * vuz.Max(); resultInPoint[ResultTypeLinear.UzRealMin] = StiffnesCoeff * vuz.Min(); resultInPoint[ResultTypeLinear.UxRealMax] = resultInPoint[ResultTypeLinear.UxMax] = 0; resultInPoint[ResultTypeLinear.UxRealMin] = resultInPoint[ResultTypeLinear.UxMin] = 0; resultInPoint[ResultTypeLinear.UyRealMax] = resultInPoint[ResultTypeLinear.UyMax] = 0; resultInPoint[ResultTypeLinear.UyRealMin] = resultInPoint[ResultTypeLinear.UyMin] = 0; } return resultInPoint; } /// /// Gets and sets list of internal forces for section. /// public List ListInternalForces { get; set; } /// /// gets and sets geometry of the section. /// public Geometry Geometry { get; set; } /// /// gets and sets width of the section. /// public double Width { get; set; } /// /// gets and sets height of the section. /// public double Height { get; set; } /// /// Gets and sets bottom reinforcement /// public double AsBottom { get; set; } /// /// Gets and sets top reinforcement /// public double AsTop { get; set; } /// /// Gets and sets left reinforcement /// public double AsLeft { get; set; } /// /// Gets and sets right reinforcement /// public double AsRight { get; set; } /// /// Gets and sets stirrup spacing /// public double Spacing { get; set; } /// /// Gets and sets transversal reinforcement density /// public double TransversalDensity { get; set; } /// /// Gets and sets minimal stiffness property of RC section. /// public double MinStiffness { get; set; } /// /// Gets and sets a list of texts with calculation warnings. /// public double StiffnesCoeff { get; set; } /// /// Gets and sets a list of texts with calculation warnings. /// public List DesignWarning { get; set; } /// /// Gets and sets a list of texts with additional calculation information. /// public List DesignInfo { get; set; } /// /// Gets and sets a list of texts with calculation errors. /// public List DesignError { get; set; } /// /// Gets and sets cref="ElementInfo" object. /// public ElementInfo Info { get; set; } } }