コード例 #1
0
        /// <summary>
        /// Create PathReinforcement on floor
        /// </summary>
        /// <param name="points">points used to create PathReinforcement</param>
        /// <param name="flip">used to specify whether new PathReinforcement is Filp</param>
        /// <returns>new created PathReinforcement</returns>
        public override PathReinforcement CreatePathReinforcement(List <Vector4> points, bool flip)
        {
            Autodesk.Revit.DB.XYZ p1, p2; Line curve;
            IList <Curve>         curves = new List <Curve>();

            for (int i = 0; i < points.Count - 1; i++)
            {
                p1    = new Autodesk.Revit.DB.XYZ(points[i].X, points[i].Y, points[i].Z);
                p2    = new Autodesk.Revit.DB.XYZ(points[i + 1].X, points[i + 1].Y, points[i + 1].Z);
                curve = Line.CreateBound(p1, p2);
                curves.Add(curve);
            }
            return(PathReinforcement.Create(m_document, m_data, curves, flip));
        }
コード例 #2
0
        /// <summary>
        /// Create PathReinforcement on floor
        /// </summary>
        /// <param name="points">points used to create PathReinforcement</param>
        /// <param name="flip">used to specify whether new PathReinforcement is Filp</param>
        /// <returns>new created PathReinforcement</returns>
        public override PathReinforcement CreatePathReinforcement(List <Vector4> points, bool flip)
        {
            Autodesk.Revit.DB.XYZ p1, p2; Line curve;
            IList <Curve>         curves = new List <Curve>();

            for (int i = 0; i < points.Count - 1; i++)
            {
                p1    = new Autodesk.Revit.DB.XYZ(points[i].X, points[i].Y, points[i].Z);
                p2    = new Autodesk.Revit.DB.XYZ(points[i + 1].X, points[i + 1].Y, points[i + 1].Z);
                curve = Line.CreateBound(p1, p2);
                curves.Add(curve);
            }
            ElementId pathReinforcementTypeId = PathReinforcementType.CreateDefaultPathReinforcementType(m_document);
            ElementId rebarBarTypeId          = RebarBarType.CreateDefaultRebarBarType(m_document);
            ElementId rebarHookTypeId         = RebarHookType.CreateDefaultRebarHookType(m_document);

            return(PathReinforcement.Create(m_document, m_data, curves, flip, pathReinforcementTypeId, rebarBarTypeId, rebarHookTypeId, rebarHookTypeId));
        }
コード例 #3
0
        PathReinforcement createPathReinforcementWithHook(Document doc, Wall wall, XYZ point1, XYZ point2, ElementId hookId, bool face)
        {
            List <Curve> curves = new List <Curve>();

            curves.Add(Line.CreateBound(point1, point2));

            ElementId defaultRebarBarTypeId          = doc.GetDefaultElementTypeId(ElementTypeGroup.RebarBarType);
            ElementId defaultPathReinforcementTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.PathReinforcementType);
            ElementId defaultHookTypeId = hookId;

            // Begin to create the path reinforcement
            PathReinforcement rein = PathReinforcement.Create(doc, wall, curves, true, defaultPathReinforcementTypeId, defaultRebarBarTypeId, defaultHookTypeId, defaultHookTypeId);

            if (null == rein)
            {
                throw new Exception("Create path reinforcement failed.");
            }

            IList <Parameter> pars = rein.GetOrderedParameters();

            foreach (Parameter par in pars)
            {
                if (par.Id.ToString() == "-1018307")
                {
                    par.SetValueString("500");
                }
                if (par.Id.ToString() == "-1018301" & face)
                {
                    par.Set(1);
                }
                if (par.Id.ToString() == "-1018302")
                {
                    double var1 = Convert.ToDouble(Shared.hSpacing);
                    double var2 = var1 + getThisValueInMeters(deltaInAxis, kA);
                    par.SetValueString("400");
                }
            }

            return(rein);
        }
コード例 #4
0
        PathReinforcement creatPathReinforcement(Document document, Wall wall, XYZ point1, XYZ point2, ElementId hookId, bool horizontal, bool last, double lastSpacing, bool face, double additionalSpaceForVerticalBars, double concreteSpace)
        {
            if (Shared.hSpacing == null)
            {
                Shared.hSpacing = "400";
            }

            if (Shared.vSpacing == null)
            {
                Shared.vSpacing = "400";
            }

            List <Curve> curves = new List <Curve>();

            curves.Add(Line.CreateBound(point1, point2));

            ElementId defaultRebarBarTypeId          = document.GetDefaultElementTypeId(ElementTypeGroup.RebarBarType);
            ElementId defaultPathReinforcementTypeId = document.GetDefaultElementTypeId(ElementTypeGroup.PathReinforcementType);
            ElementId defaultHookTypeId = ElementId.InvalidElementId;

            if (hookId != null)
            {
                defaultHookTypeId = hookId;
            }

            PathReinforcement rein = PathReinforcement.Create(document, wall, curves, true, defaultPathReinforcementTypeId, defaultRebarBarTypeId, defaultHookTypeId, defaultHookTypeId);

            if (null == rein)
            {
                throw new Exception("Create path reinforcement failed.");
            }

            IList <Parameter> parameters = rein.GetOrderedParameters();

            foreach (Parameter par in parameters)
            {
                if (par.Id.ToString() == "-1018301" & face)
                {
                    par.Set(1);
                }
                if (par.Id.ToString() == "-1018302")
                {
                    if (!last && horizontal)
                    {
                        par.SetValueString(Shared.hSpacing);
                    }
                    else if (!last && !horizontal)
                    {
                        par.SetValueString(Shared.vSpacing);
                    }
                    else
                    {
                        par.SetValueString(lastSpacing.ToString());
                    }
                }
                if (horizontal)
                {
                    if (par.Id.ToString() == "-1018307")
                    {
                        par.SetValueString((getLengthOf(wall) - getThisValueInMeters(deltaInAxis * 2, kA)).ToString());
                    }
                }
                else
                {
                    if (par.Id.ToString() == "-1018307")
                    {
                        par.SetValueString((getHeightOf(wall) + additionalSpaceForVerticalBars).ToString());
                    }
                }
                if (concreteSpace != 0)
                {
                    if (par.Id.ToString() == "-1018307")
                    {
                        par.SetValueString(concreteSpace.ToString());
                    }
                }
                if (par.Id.ToString() == "-1018322")
                {
                    par.SetValueString(Convert.ToString(getThisValueInMeters(deltaInAxis, kA)) + "mm");
                }
            }

            return(rein);
        }