Hi All,
I'm looking a way to get the center Rebar from a Rebar Layout (Maximum spacing). I need to get this element to get its Centerline to create a DetailLine in the same position.
Any thoughts?
Thanks in advance!
Solved! Go to Solution.
Hi All,
I'm looking a way to get the center Rebar from a Rebar Layout (Maximum spacing). I need to get this element to get its Centerline to create a DetailLine in the same position.
Any thoughts?
Thanks in advance!
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
I asked the development team for you...
I asked the development team for you...
Hi @jeremytammik , by now I managed to do this:
double numBars = barra.NumberOfBarPositions; double indice = 0; // Si es Par if (numBars % 2 == 0) { indice = (numBars / 2) - 1; } // Si es impar else { indice = Math.Truncate(numBars / 2); } #endregion #region SE CREAN LOS DETAIL LINES EN LA POSICION DE LA BARRA CENTRAL if (numBars > 1) { IList<Curve> curva_patron = barra.GetCenterlineCurves( true, true, true, MultiplanarOption.IncludeOnlyPlanarCurves, Convert.ToInt32(indice)); DetailCurve dc = doc.Create.NewDetailCurve( doc.ActiveView, curva_patron.First()); dc.LineStyle = fe_losa; }
In my iteration, get the "indice" variable (index) as the number I want (the middle index), and using the GetCenterlineCurves with that index, I always get the first one and my detail line is created in this position.
What am I doing wrong?
Regards!
Hi @jeremytammik , by now I managed to do this:
double numBars = barra.NumberOfBarPositions; double indice = 0; // Si es Par if (numBars % 2 == 0) { indice = (numBars / 2) - 1; } // Si es impar else { indice = Math.Truncate(numBars / 2); } #endregion #region SE CREAN LOS DETAIL LINES EN LA POSICION DE LA BARRA CENTRAL if (numBars > 1) { IList<Curve> curva_patron = barra.GetCenterlineCurves( true, true, true, MultiplanarOption.IncludeOnlyPlanarCurves, Convert.ToInt32(indice)); DetailCurve dc = doc.Create.NewDetailCurve( doc.ActiveView, curva_patron.First()); dc.LineStyle = fe_losa; }
In my iteration, get the "indice" variable (index) as the number I want (the middle index), and using the GetCenterlineCurves with that index, I always get the first one and my detail line is created in this position.
What am I doing wrong?
Regards!
Dear Jorge,
Thank you for your update and congratulations on the progress.
I heard back from the development team, and they say:
The property Rebar.NumberOfBarPositions will give us the number of bars in the set.
The Method Rebar.GetCenterlineCurves receives a barPositionIndex and will return the centreline curves for that bar.
I’m not sure what you mean by 'centre bar'; if in the set are 4 bars (indexes 0,1,2,3). It should be index 1 or 2?
public IList<Curve> GetCenterlineCurves( bool adjustForSelfIntersection, bool suppressHooks, bool suppressBendRadius, MultiplanarOption multiplanarOption, int barPositionIndex)
What is missing in your code: GetCenterlineCurves will return the curves as they are positioned on the first bar.
You can obtain a transform which will move the curves into the desired position:
RebarShapeDrivenAccessor accessor = rebar.GetShapeDrivenAccessor(); Transform trf = accessor.GetBarPositionTransform(indice); // Now apply the trf on each curve obtained from calling GetCenterlineCurves()
I hope this helps.
Best regards,
Jeremy
Dear Jorge,
Thank you for your update and congratulations on the progress.
I heard back from the development team, and they say:
The property Rebar.NumberOfBarPositions will give us the number of bars in the set.
The Method Rebar.GetCenterlineCurves receives a barPositionIndex and will return the centreline curves for that bar.
I’m not sure what you mean by 'centre bar'; if in the set are 4 bars (indexes 0,1,2,3). It should be index 1 or 2?
public IList<Curve> GetCenterlineCurves( bool adjustForSelfIntersection, bool suppressHooks, bool suppressBendRadius, MultiplanarOption multiplanarOption, int barPositionIndex)
What is missing in your code: GetCenterlineCurves will return the curves as they are positioned on the first bar.
You can obtain a transform which will move the curves into the desired position:
RebarShapeDrivenAccessor accessor = rebar.GetShapeDrivenAccessor(); Transform trf = accessor.GetBarPositionTransform(indice); // Now apply the trf on each curve obtained from calling GetCenterlineCurves()
I hope this helps.
Best regards,
Jeremy
Hi @jeremytammik ,
Following your indication I made exactly what I needed. Here is a snippet of the code II'm using so it may help some else in the future and the visual representation of what I achieved!
IList<Curve> curva_patron = barra.GetCenterlineCurves( true, true, true, MultiplanarOption.IncludeOnlyPlanarCurves, Convert.ToInt32(indice)); // Se lleva la curva a la posicion central RebarShapeDrivenAccessor accessor = barra.GetShapeDrivenAccessor(); Transform trf = accessor.GetBarPositionTransform(Convert.ToInt32(indice)); Curve curva_trans = curva_patron.First().CreateTransformed(trf); DetailCurve dc = doc.Create.NewDetailCurve( doc.ActiveView, curva_trans); dc.LineStyle = fe_losa;
Again, thanks a lot!
Regards.
Hi @jeremytammik ,
Following your indication I made exactly what I needed. Here is a snippet of the code II'm using so it may help some else in the future and the visual representation of what I achieved!
IList<Curve> curva_patron = barra.GetCenterlineCurves( true, true, true, MultiplanarOption.IncludeOnlyPlanarCurves, Convert.ToInt32(indice)); // Se lleva la curva a la posicion central RebarShapeDrivenAccessor accessor = barra.GetShapeDrivenAccessor(); Transform trf = accessor.GetBarPositionTransform(Convert.ToInt32(indice)); Curve curva_trans = curva_patron.First().CreateTransformed(trf); DetailCurve dc = doc.Create.NewDetailCurve( doc.ActiveView, curva_trans); dc.LineStyle = fe_losa;
Again, thanks a lot!
Regards.
Can't find what you're looking for? Ask the community or share your knowledge.