Esempio n. 1
0
        /// <summary>
        /// Create the vertical rebar according the location
        /// </summary>
        /// <param name="location">location of rebar which need to be created</param>
        /// <returns>the created rebar, return null if the creation is unsuccessful</returns>
        public Rebar FillVerticalBar(VerticalRebarLocation location)
        {
            //calculate the rebar number in different location
            int rebarNubmer = m_verticalRebarNumber / 4;

            switch (location)
            {
            case VerticalRebarLocation.East:    // the east vertical rebar
                if (0 < m_verticalRebarNumber % 4)
                {
                    rebarNubmer++;
                }
                break;

            case VerticalRebarLocation.North:   // the north vertical rebar
                if (2 < m_verticalRebarNumber % 4)
                {
                    rebarNubmer++;
                }
                break;

            case VerticalRebarLocation.West:    // the west vertical rebar
                if (1 < m_verticalRebarNumber % 4)
                {
                    rebarNubmer++;
                }
                break;

            case VerticalRebarLocation.South:   // the south vertical rebar
                break;
            }

            // get the geometry information for rebar creation
            RebarGeometry geomInfo = m_geometry.GetVerticalRebar(location, rebarNubmer);

            // create the rebar
            return(PlaceRebars(m_verticalType, null, null, geomInfo,
                               RebarHookOrientation.Left, RebarHookOrientation.Left));
        }
Esempio n. 2
0
        /// <summary>
        /// Create the vertical reinforcement according the location
        /// </summary>
        /// <param name="location">location of rebar which need to be created</param>
        /// <returns>the created reinforcement, return null if the creation is unsuccessful</returns>
        public RebarContainerItem FillVerticalItem(RebarContainer cont, VerticalRebarLocation location)
        {
            //calculate the reinforcement number in different location
            int rebarNubmer = m_verticalRebarNumber / 4;

            switch (location)
            {
            case VerticalRebarLocation.East:    // the east vertical reinforcement
                if (0 < m_verticalRebarNumber % 4)
                {
                    rebarNubmer++;
                }
                break;

            case VerticalRebarLocation.North:   // the north vertical reinforcement
                if (2 < m_verticalRebarNumber % 4)
                {
                    rebarNubmer++;
                }
                break;

            case VerticalRebarLocation.West:    // the west vertical reinforcement
                if (1 < m_verticalRebarNumber % 4)
                {
                    rebarNubmer++;
                }
                break;

            case VerticalRebarLocation.South:   // the south vertical reinforcement
                break;
            }

            // get the geometry information for reinforcement creation
            RebarGeometry geomInfo = m_geometry.GetVerticalRebar(location, rebarNubmer);

            // create the container item
            return(PlaceContainerItem(cont, m_verticalType, null, null, geomInfo, RebarHookOrientation.Right, RebarHookOrientation.Right));
        }
Esempio n. 3
0
        /// <summary>
        /// Get the geometry information of vertical rebar
        /// </summary>
        /// <param name="location">the location of vertical rebar</param>
        /// <param name="rebarNumber">the spacing value of the rebar</param>
        /// <returns>the gotted geometry information</returns>
        public RebarGeometry GetVerticalRebar(VerticalRebarLocation location, int rebarNumber)
        {
            // sort the points of the swept profile
            XYZHeightComparer comparer = new XYZHeightComparer();

            m_points.Sort(comparer);

            // Get the offset and rebar length of rebar
            double offset      = ColumnRebarData.VerticalOffset;
            double rebarLength = m_columnHeight + 3; //the length of rebar

            // Get the start point of the vertical rebar curve
            Autodesk.Revit.DB.XYZ startPoint = m_drivingLine.GetEndPoint(0);

            List <Autodesk.Revit.DB.XYZ> movedPoints = OffsetPoints(offset);

            movedPoints.Sort(comparer);

            Autodesk.Revit.DB.XYZ normal = new Autodesk.Revit.DB.XYZ(); // the normal parameter
            double rebarOffset           = 0;                           // rebar offset, equal to rebarNumber* spacing

            // get the normal, start point and rebar offset of vertical rebar
            switch (location)
            {
            case VerticalRebarLocation.East:   //vertical rebar in east
                normal      = new Autodesk.Revit.DB.XYZ(0, 1, 0);
                rebarOffset = m_columnWidth - 2 * offset;
                startPoint  = movedPoints[1];
                break;

            case VerticalRebarLocation.North: //vertical rebar in north
                normal      = new Autodesk.Revit.DB.XYZ(-1, 0, 0);
                rebarOffset = m_columnLength - 2 * offset;
                startPoint  = movedPoints[3];
                break;

            case VerticalRebarLocation.West: //vertical rebar in west
                normal      = new Autodesk.Revit.DB.XYZ(0, -1, 0);
                rebarOffset = m_columnWidth - 2 * offset;
                startPoint  = movedPoints[2];
                break;

            case VerticalRebarLocation.South: //vertical rebar in south
                normal      = new Autodesk.Revit.DB.XYZ(1, 0, 0);
                rebarOffset = m_columnLength - 2 * offset;
                startPoint  = movedPoints[0];
                break;

            default:
                break;
            }

            double spacing = rebarOffset / rebarNumber; //spacing value of the rebar

            Autodesk.Revit.DB.XYZ endPoint = GeomUtil.OffsetPoint(startPoint, m_drivingVector, rebarLength);

            IList <Curve> curves = new List <Curve>();  //profile of the rebar

            curves.Add(Line.CreateBound(startPoint, endPoint));

            // return the rebar geometry information
            return(new RebarGeometry(normal, curves, rebarNumber, spacing));
        }
Esempio n. 4
0
        /// <summary>
        /// Get the geometry information of vertical rebar
        /// </summary>
        /// <param name="location">the location of vertical rebar</param>
        /// <param name="rebarNumber">the spacing value of the rebar</param>
        /// <returns>the gotted geometry information</returns>
        public RebarGeometry GetVerticalRebar(VerticalRebarLocation location, int rebarNumber)
        {
            // sort the points of the swept profile
            XYZHeightComparer comparer = new XYZHeightComparer();
            m_points.Sort(comparer);

            // Get the offset and rebar length of rebar
            double offset = ColumnRebarData.VerticalOffset;
            double rebarLength = m_columnHeight + 3; //the length of rebar

            // Get the start point of the vertical rebar curve
            Autodesk.Revit.DB.XYZ startPoint = m_drivingLine.get_EndPoint(0);

            List<Autodesk.Revit.DB.XYZ > movedPoints = OffsetPoints(offset);
            movedPoints.Sort(comparer);

            Autodesk.Revit.DB.XYZ normal = new Autodesk.Revit.DB.XYZ (); // the normal parameter
            double rebarOffset = 0; // rebar offset, equal to rebarNumber* spacing
            // get the normal, start point and rebar offset of vertical rebar
            switch (location)
            {
                case VerticalRebarLocation.East:   //vertical rebar in east
                    normal = new Autodesk.Revit.DB.XYZ (0, 1, 0);
                    rebarOffset = m_columnWidth - 2 * offset;
                    startPoint = movedPoints[1];
                    break;
                case VerticalRebarLocation.North: //vertical rebar in north
                    normal = new Autodesk.Revit.DB.XYZ (-1, 0, 0);
                    rebarOffset = m_columnLength - 2 * offset;
                    startPoint = movedPoints[3];
                    break;
                case VerticalRebarLocation.West: //vertical rebar in west
                    normal = new Autodesk.Revit.DB.XYZ (0, -1, 0);
                    rebarOffset = m_columnWidth - 2 * offset;
                    startPoint = movedPoints[2];
                    break;
                case VerticalRebarLocation.South: //vertical rebar in south
                    normal = new Autodesk.Revit.DB.XYZ (1, 0, 0);
                    rebarOffset = m_columnLength - 2 * offset;
                    startPoint = movedPoints[0];
                    break;
                default:
                    break;
            }

            double spacing = rebarOffset / rebarNumber; //spacing value of the rebar
            Autodesk.Revit.DB.XYZ endPoint = GeomUtil.OffsetPoint(startPoint, m_drivingVector, rebarLength);

            IList<Curve> curves = new List<Curve>();       //profile of the rebar
            curves.Add(Line.get_Bound(startPoint, endPoint));

            // return the rebar geometry information
            return new RebarGeometry(normal, curves, rebarNumber, spacing);
        }
Esempio n. 5
0
        /// <summary>
        /// Create the vertical rebar according the location
        /// </summary>
        /// <param name="location">location of rebar which need to be created</param>
        /// <returns>the created rebar, return null if the creation is unsuccessful</returns>
        public Rebar FillVerticalBar(VerticalRebarLocation location)
        {
            //calculate the rebar number in different location
             int rebarNubmer = m_verticalRebarNumber / 4;
             switch (location)
             {
            case VerticalRebarLocation.East:    // the east vertical rebar
               if (0 < m_verticalRebarNumber % 4)
               {
                  rebarNubmer++;
               }
               break;
            case VerticalRebarLocation.North:   // the north vertical rebar
               if (2 < m_verticalRebarNumber % 4)
               {
                  rebarNubmer++;
               }
               break;
            case VerticalRebarLocation.West:    // the west vertical rebar
               if (1 < m_verticalRebarNumber % 4)
               {
                  rebarNubmer++;
               }
               break;
            case VerticalRebarLocation.South:   // the south vertical rebar
               break;
             }

             // get the geometry information for rebar creation
             RebarGeometry geomInfo = m_geometry.GetVerticalRebar(location, rebarNubmer);

             // create the rebar
             return PlaceRebars(m_verticalType, null, null, geomInfo,
                                     RebarHookOrientation.Left, RebarHookOrientation.Left);
        }