Пример #1
0
        /// <summary>
        /// Add SurfaceReinforcement to slab.
        /// Internal method use by GH components and Dynamo nodes.
        /// </summary>
        public static Shells.Slab AddReinforcementToSlab(Shells.Slab slab, List <SurfaceReinforcement> srfReinfs)
        {
            // deep clone. downstreams objs will contain changes made in this method, upstream objs will not.
            // downstream and uppstream objs will share guid.
            Shells.Slab clone = slab.DeepClone();

            // check if slab material is concrete
            if (clone.Material.Concrete == null)
            {
                throw new System.ArgumentException("Material of slab must be concrete");
            }

            // check if mixed layers
            if (SurfaceReinforcement.MixedLayers(srfReinfs))
            {
                throw new System.ArgumentException("Can't add mixed layers to the same slab");
            }

            if (SurfaceReinforcement.AllStraight(srfReinfs))
            {
                return(SurfaceReinforcement.AddStraightReinfToSlab(clone, srfReinfs));
            }
            else if (SurfaceReinforcement.AllCentric(srfReinfs))
            {
                return(SurfaceReinforcement.AddCentricReinfToSlab(clone, srfReinfs));
            }
            else
            {
                throw new System.ArgumentException("Can't add mixed surface reinforcement layouts to the same slab.");
            }
        }
Пример #2
0
 private static Shells.Slab AddCentricReinfToSlab(Shells.Slab slab, List <SurfaceReinforcement> srfReinfs)
 {
     if (SurfaceReinforcement.AllCentric(srfReinfs))
     {
         throw new System.ArgumentException("Method to add centric surface reinforcement is not implemented yet.");
     }
     else
     {
         throw new System.ArgumentException("Not all passed surface reinforcement objects are of layout type centric");
     }
 }