how to get distance between two stirrups existing in the same level

how to get distance between two stirrups existing in the same level

Anonymous
Not applicable
901 Views
6 Replies
Message 1 of 7

how to get distance between two stirrups existing in the same level

Anonymous
Not applicable

I have been trying to get the distance between ties . I have get the vertical spacings through bounding box property .
But when the ties are in the same level, due to hooks , I'm unable to get the distances using the bounding box method. My job would be done if I could get the bounding box property of only the plain bars , without any effect of hooks. 

I want to get the 4"  distance through revit api. But as , while coding I don't how the tie's orientation will be , I can't take the the bounding box.Max() or Min() method to get the coordinates. 

ps. this is just a practice model with arbitrary rebar sizes.

Revit.jpg

0 Likes
902 Views
6 Replies
Replies (6)
Message 2 of 7

jeremy_tammik
Alumni
Alumni

Please explain more precisely what distance you are trying to get.

 

Be aware that I, for one, did not know what a stirrup or tie is, until I read it up to on Wikipedia to address your question:

  

https://en.wikipedia.org/wiki/Rebar#Stirrups

  

So you can probably imagine that I could use a bit more detail and maybe an additional sketch to understand your exact goal. A dimension added to your sketch showing the desired distance would help, for instance.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 7

Anonymous
Not applicable

Ties are the transverse reinforcemnet of a column and stirrups are the transverse reinforcement of a beam. 
Here I'm working with a column, trying to get the internal distance between ties which are at the same vertical level.

I tried to make the model bit cleaner.  In the first figure, there is an isolated single column where the highligted rebar is a tie (there are 4 other ties are visible at different vertical levels) . The second fig is the cross section of the same column. I'm trying to access the distances between the rebars (or the dimensions shown in the figure i.g 4" ,12.24" , 4.26") of the cross section using revit api.
 

0 Likes
Message 4 of 7

RPTHOMAS108
Mentor
Mentor

I believe this is relatively easy if you look at the view specific geometry for the bars which are the links in wireframe form.

 

You will find within the geometry element of these a number of arcs and lines representing all the bars set out by spacing rule i.e. there are a number of repeating curves for each bar (from which you only need the unique curves forming one of those bars). If you transform the curve into the coordinate space of the view or the element it is within then you can separate out the relevant horizontal lines (that cross the body of the element that you want to dimension between) from the vertical lines and arcs that wrap around the longitudinal bars at each cover face.

 

When all curves are transformed into the coordinate space of your sectional view or that of the element itself you can also distinguish the curves by z-ord i.e. in order to single out a unique bar.

 

 It should be noted that bars can vary across the set but for your case of uniform cross section it doesn't

 

Note also the method Rebar.GetCenterlineCurves could be used as an alternative. However the curve geometry previously mentioned contains references that could be useful for dimensioning. This may also be true for Rebar.GetCenterlineCurves but I've not looked at that.

 

The other checking information to hand is bar bending shape dims compared with line lengths. That is deducting bend radius or diameter from bending dims to arrive at same matching line length. Deduction of diameter or radius would depend on if line is between two bends or represents an end straight. You would also perhaps have to consider bar diameter in that. Some regions such as UK dimension between bars extents not centre lines (in terms of bar bending dimensions). I believe Revit tends to work that way anyway especially between face covers.

0 Likes
Message 5 of 7

Anonymous
Not applicable

@RPTHOMAS108 , Thanks for your suggestion.
I'm a novice in this sector, so converting your suggestion into coding is a bit impossible for me right now.

But I have get a solution using Revit lookup. The desired rebar -> Lookup -> Current Selection -> Get Shape Driven Accessor -> Compute Driving Curves -> Origin.
The origin contains the coordinate of the straight portion irrespective of hooks which I was looking. 

But another problem has been occurred. Though the lookup shows Compute Driving Curves contains "origin" property, it is not accessible through revit api.  Shape Driven Accessor has 2 methods, Compute Driving Curves() and Get Distribution Path(). The api can get access to all of the properties of the Get Distribution Path(), but it is not getting the properties for the Compute Driving Curves(). I have gone through the api docs , it didn't help me either.

Rebar.GetShapeDrivenAccessor().GetDistributionPath().Origin;     // this is achievable 
Rebar.GetShapeDrivenAccessor().ComputeDrivingCurves() ;          // It is not getting any "origin" property

Though according to Revit Lookup , both of the methods have all the same properties.

Can anyone guide me how can I get the access to the "origin" property of the Compute Driving Curves Method, please?? (the highlighted property in the second figure)

 

Revit 4.jpg

 Revit 4 .jpg

 





0 Likes
Message 6 of 7

Anonymous
Not applicable

I get the origin through casting. Thanks 😄 

IList<Curve> a1 = Rebar.GetShapeDrivenAccessor().ComputeDrivingCurves();

foreach (Curve C in a1)
{
      Line L = C as Line;
      XYZ a = L.Origin;
}

0 Likes
Message 7 of 7

jeremy_tammik
Alumni
Alumni

Congratulations on solving it. Well done!

  

In addition, please understand that RevitLookup is completely open source and implemented exclusively using the open Revit API that you have access to as well.

  

Therefore, everything done in RevitLookup can be done by you in your add-in as well.

  

The easiest way to see how it is achieved in RevitLookup is to run it in the Visual Studio debugger and track the Revit API calls it makes step by step.

  

Then, you can reproduce the same call in your add-in to achieve the same result there as well.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes