Beispiel #1
0
        public static List <IReinforcingBar> ReinforcingBars(this Bar bar)
        {
            if (bar.IsNull())
            {
                return(null);
            }

            List <IReinforcingBar> rebars  = new List <IReinforcingBar>();
            ConcreteSection        section = bar.SectionProperty as ConcreteSection;

            List <ICurve> outerProfileEdges;
            List <ICurve> innerProfileEdges;
            List <LongitudinalReinforcement> longReif;
            List <TransverseReinforcement>   tranReif;
            double longCover, tranCover;

            if (section.CheckSectionAndExtractParameters(out outerProfileEdges, out innerProfileEdges, out longReif, out tranReif, out longCover, out tranCover))
            {
                TransformMatrix transformation = bar.BarSectionTranformation();
                double          length         = bar.Length();

                List <IBarReinforcement> barReinf = new List <IBarReinforcement>();
                barReinf.AddRange(longReif);
                barReinf.AddRange(tranReif);

                foreach (IBarReinforcement reif in barReinf)
                {
                    Material material;
                    if (reif.Material != null)
                    {
                        material = Physical.Create.Material(reif.Material);
                    }
                    else
                    {
                        material = new Material();
                    }

                    if (reif is LongitudinalReinforcement)
                    {
                        foreach (ICurve centreLine in reif.IReinforcementLayout(longCover, outerProfileEdges, innerProfileEdges, length, transformation))
                        {
                            PrimaryReinforcingBar rebar = Physical.Create.PrimaryReinforcingBar(centreLine, reif.Diameter, material);
                            rebars.Add(rebar);
                        }
                    }
                    else if (reif is TransverseReinforcement)
                    {
                        foreach (ICurve centreLine in reif.IReinforcementLayout(tranCover, outerProfileEdges, innerProfileEdges, length, transformation))
                        {
                            Stirrup rebar = Physical.Create.Stirrup(centreLine, reif.Diameter, material);
                            rebars.Add(rebar);
                        }
                    }
                }
            }

            return(rebars);
        }
Beispiel #2
0
        /***************************************************/
        /****              Public methods               ****/
        /***************************************************/

        public static Rebar ToRevitRebar(this PrimaryReinforcingBar bar, Document document, RevitSettings settings = null, Dictionary <Guid, List <int> > refObjects = null)
        {
            return(ToRevitRebar((IReinforcingBar)bar, document, settings, refObjects));
        }