Example #1
0
        /// <summary>
        /// Create an Advance Steel Rectangular Shear Stud Pattern By Rectangle
        /// </summary>
        /// <param name="rectangle"> Input Dynamo Rectangle </param>
        /// <param name="objectToConnect"> Object to attached ShearStud </param>
        /// <param name="studLength"> Input Shear Stud Length</param>
        /// <param name="studDiameter"> Input Shear Stud Diameter</param>
        /// <param name="noOfShearStudsX"> Input Number of Shear Stud X Direction</param>
        /// <param name="noOfShearStudsY"> Input Number of Shear Stud Y Direction</param>
        /// <param name="shearStudConnectionType"> Input Shear Bolt Connection type - Shop Bolt Default</param>
        /// <param name="additionalShearStudParameters"> Optional Input ShearStud Build Properties </param>
        /// <returns name="rectangularShearStudsPattern"> rectangularShearStudsPattern</returns>
        public static RectangularShearStudsPattern ByRectangle(Autodesk.DesignScript.Geometry.Rectangle rectangle,
                                                               SteelDbObject objectToConnect,
                                                               double studLength,
                                                               double studDiameter,
                                                               [DefaultArgument("2;")] int noOfShearStudsX,
                                                               [DefaultArgument("2;")] int noOfShearStudsY,
                                                               [DefaultArgument("2;")] int shearStudConnectionType,
                                                               [DefaultArgument("null")] List <Property> additionalShearStudParameters)
        {
            var dynCorners = rectangle.Corners();
            var astCorners = Utils.ToAstPoints(dynCorners, true);
            var vx         = astCorners[1] - astCorners[0];
            var vy         = astCorners[3] - astCorners[0];
            var vz         = Utils.ToAstVector3d(rectangle.Normal, true);

            vx = vx.Normalize();
            vy = vy.Normalize();
            vz = vz.Normalize();

            List <SteelDbObject> tempList = new List <SteelDbObject>()
            {
                objectToConnect
            };
            List <string> handlesList = Utils.GetSteelDbObjectsToConnect(tempList);

            var      rectangleCenter = astCorners[0] + (astCorners[2] - astCorners[0]) * 0.5;
            Matrix3d matrix3D        = new Matrix3d();

            matrix3D.SetCoordSystem(rectangleCenter, vx, vy, vz);

            additionalShearStudParameters = PreSetValuesInListProps(additionalShearStudParameters, noOfShearStudsX, noOfShearStudsY, Utils.ToInternalDistanceUnits(studLength, true), Utils.ToInternalDistanceUnits(studDiameter, true));

            return(new RectangularShearStudsPattern(astCorners[0], astCorners[2], handlesList[0], vx, vy, matrix3D,
                                                    additionalShearStudParameters, shearStudConnectionType));
        }
Example #2
0
        /// <summary>
        /// Create an Advance Steel Rectangular Anchor Pattern bound By Rectangle
        /// </summary>
        /// <param name="rectangle"> Input rectangle </param>
        /// <param name="noOfBoltsX"> Input No of Anchor Bolts in the X direction</param>
        /// <param name="noOfBoltsY"> Input No of Anchor Bolts in the Y direction</param>
        /// <param name="objectsToConnect"> Input Objects to be bolted </param>
        /// <param name="boltConnectionType"> Input Bolt Connection type - Shop Bolt Default</param>
        /// <param name="additionalAnchorBoltParameters"> Optional Input Anchor Bolt Build Properties </param>
        /// <returns name="rectangularAnchorPattern"> rectangularAnchorPattern</returns>
        public static RectangularAnchorPattern ByRectangle(Autodesk.DesignScript.Geometry.Rectangle rectangle,
                                                           [DefaultArgument("2;")] int noOfBoltsX,
                                                           [DefaultArgument("2;")] int noOfBoltsY,
                                                           IEnumerable <SteelDbObject> objectsToConnect,
                                                           [DefaultArgument("2;")] int boltConnectionType,
                                                           [DefaultArgument("null")] List <Property> additionalAnchorBoltParameters)
        {
            List <string> handlesList = Utils.GetSteelDbObjectsToConnect(objectsToConnect);

            var dynCorners = rectangle.Corners();
            var astCorners = Utils.ToAstPoints(dynCorners, true);
            var vx         = astCorners[1] - astCorners[0];
            var vy         = astCorners[3] - astCorners[0];

            additionalAnchorBoltParameters = PreSetValuesInListProps(additionalAnchorBoltParameters, noOfBoltsX, noOfBoltsY);

            return(new RectangularAnchorPattern(astCorners[0], astCorners[2], handlesList, vx, vy, additionalAnchorBoltParameters, boltConnectionType));
        }