Issue of Calling Rebar Creation Function

Hi all,

I’m here to post a issue happened when I am using rebar creation function in Python - Rebar.CreateFromCurves, the RevitAPI of 2014.

I just want create a simple L-bar on a slab. However when I ran the script it prompts “Exception: Unable to match an existing RebarShape to the given curves.” And the lines forming the rebar are checked to be right angel.So I am confused about the error: is it the script has something wrong, or maybe there is some bug on this Function…

Please help.

Hello Ocean!

I can’t see anything wrong with your script, (though I don’t understand what you have plugged into port IN[6])

The lines are probably not completely perpendicular, see this article:

The algorithm of creation of shape is quite complicated. Basically the problem can occur for shapes defined by segments (lines) forming RIGHT ANGLE between themselves. They have to be defined very precisely (different digits on 7 or 8 place after decimal separator can cause exception). The best solution for customer in this situation is to round all coordinates to 6 digits after decimal separator.

Try to redraw your lines, does in work with only one line?
You can also try to draw one of the lines, an construct a normal in Dynamo.

Hi Einar,

Thanks for correction, actually the Port IN[6] is aiming to input rebar shape(M_17A, US standard) to the python script but I didn’t find its mistake:)

I have seen this article before and checked the angle between these 2 lines and it is 90 degree (rounding to 0.00000001). But this could be the only reason that can be searched on Internet, think I will do more test on this issue.

Also I changed to using straight bar but still no lucks:( here posted some pictures:


How is your setting regarding to rebar hooks and shape definition? You have put in 90 deg hooks in your create function, but if hooks are incuded in the shape, you have to draw them as well. For your cript to work, it must be set like this:

Another thing to try: Use detail lines in stead of model lines. Then you are sure they will be in the same work plane as your section.