Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Varying Rebar Set - EXPLODE!

Varying Rebar Set - EXPLODE!

IMAGINE BEING ABLE TO EXPLODE A VARYING REBAR SET SO EACH BAR CAN BE EDITED FOR CUSTOM USES. 

IT WOULD BE GREAT!

1 Comment
jamess166
Advocate

Good day, you managed to relize it, I have not been able to do it yet, it is the advance of my code. 

The problems I have had are: for straight bars they are all modeled in the same place, but for bars such as the image, nothing appears to me.

 

public void CreateRebar (Document doc, Rebar rebarFather,int index)
        {
            //FamilyInstance host, RebarBarType barType, RebarHookType hookType
            
            //genericas de parametros
            GetSetParameterValues getSet = new GetSetParameterValues();

            //Seleccionar si es standart o estribo
            int intRebarStyle = getSet.GetParameterValueInt(rebarFather.get_Parameter(BuiltInParameter.REBAR_BAR_STYLE));
            RebarStyle rebarStyle;

            if (intRebarStyle==0)
            {
                rebarStyle = RebarStyle.Standard;
            }
            else
            {
                rebarStyle = RebarStyle.StirrupTie;
            }

            //rebar bar type
            Parameter typeParameter = rebarFather.get_Parameter(BuiltInParameter.ELEM_TYPE_PARAM);
            ElementId idType = typeParameter.AsElementId();
            RebarBarType rebarBarType = doc.GetElement(idType) as RebarBarType;

            //rebar start hook type
            ElementId idStartHookType = rebarFather.GetHookTypeId(0);
            RebarHookType startHookType = doc.GetElement(idStartHookType) as RebarHookType;

            //rebar End hook type
            ElementId idEndHookType = rebarFather.GetHookTypeId(1);
            RebarHookType endtHookType = doc.GetElement(idEndHookType) as RebarHookType;

            //host element
            ElementId hostId = rebarFather.GetHostId();
            Element elementHost = doc.GetElement(hostId);

            //location point            
            LocationCurve locationPoint = elementHost.Location as LocationCurve;
            Curve curve = locationPoint.Curve;
            XYZ origen = curve.GetEndPoint(0);
            //XYZ normal = origen.Normalize();

            //lista curvas
            IList<Curve> listCurve = rebarFather.GetCenterlineCurves(false, true, true, MultiplanarOption.IncludeOnlyPlanarCurves, index);
            
            //RebarHoookOrientation Start
            RebarHookOrientation starHookOrientation = rebarFather.GetHookOrientation(0);
            RebarHookOrientation endHookOrientation = rebarFather.GetHookOrientation(1);

            // using transacion asignar los parametros
            using (Transaction t = new Transaction(doc, "Create Rebar"))
            {
                t.Start("Create Rebar");
                Rebar rebar = Rebar.CreateFromCurves(doc, rebarStyle, rebarBarType, startHookType, endtHookType
                , elementHost, new XYZ(0, 0, 1), listCurve, starHookOrientation, endHookOrientation, true, false);
                t.Commit();
            }
        }

 Captura3.PNG

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Forma Design Contest


Autodesk Design & Make Report