# Error when creating rebar following PolyCurves

**URL:** <https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754>\
**Category:** Packages\
**Created:** [June 28, 2016, 1:24pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754 "2016-06-28T13:24:58Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 28, 2016, 1:24pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/1 "2016-06-28T13:24:59Z")

</div>

Hi,  
I’m trying to create rebars in revit by following the polycurves that can be seen in blue in the photo, but I always get an internal error. I suspect it has something to do with the vector but I’m not sure. Could someone explain to me why I’m getting this error and how to fix it?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d3a81cd10a79b07a917a1563d86d58362115e152.png)  
Thank you in advance

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [June 28, 2016, 1:40pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/2 "2016-06-28T13:40:25Z")

</div>

Hi,  
I think you need to Join the curves using “Polycurve.ByJoinedCurves” and also see this topic it might help you [Setting rebar container dimensions in Dynamo (Dynamo for Rebar)](https://forum.dynamobim.com/t/setting-rebar-container-dimensions-in-dynamo-dynamo-for-rebar/4438/)

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 28, 2016, 1:41pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/3 "2016-06-28T13:41:53Z")

</div>

Thank you I will try that 🙂

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 28, 2016, 1:46pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/4 "2016-06-28T13:46:15Z")

</div>

Try to add Flatten after the last Curve.Join node.

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 28, 2016, 1:59pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/5 "2016-06-28T13:59:35Z")

</div>

I tried that but it did not work but thank you

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 28, 2016, 2:10pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/6 "2016-06-28T14:10:06Z")

</div>

I used “Polycurve.ByJoinedCurves” but I got the same error

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/a/a967e614ee46f5563f122e684cf65d5f352bfb9a.png)

Am I maybe using the wrong curve to produce the normal vector?

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [June 28, 2016, 2:14pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/7 "2016-06-28T14:14:30Z")

</div>

Can you drop here your files. So that we can have closer look at it.

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 28, 2016, 2:32pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/8 "2016-06-28T14:32:52Z")

</div>

Here is a link to the files (I can not upload attachments since I’m a new user), thank you so much 🙂 [https://drive.google.com/open?id=0B56f0ykmnoVBYTlWS2Jka1B0Y1E](https://drive.google.com/open?id=0B56f0ykmnoVBYTlWS2Jka1B0Y1E)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 28, 2016, 4:51pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/9 "2016-06-28T16:51:17Z")

</div>

I wasn’t able to download your revit file, but I tested your script and it works fine with me on

Dynamo 1.0  
Revit 2017  
Dynamo for Rebar 1.0.0

---

<div class="post-metadata">

**Author:** ![TSF](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@TSF](https://forum.dynamobim.com/u/TSF)\
**Post date:** [June 29, 2016, 8:55am UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/10 "2016-06-29T08:55:19Z")

</div>

Hi

As far as I can tell you are using the correct polycurve (Polycurve.ByJoinedCurves) and normal vector nodes. The issue with Curve.Join is that the polycurve it generates is a list of curves and the node will then create separate rebar sections instead of a continuous bar. I’ve found that once you get an internal error on that node, you sometimes need to restart Revit before it will work again, even if you have fixed the input nodes. You don’t need the Group Curves node, you can feed the Flatten node straight into the PolyCurve.ByJoinedCurves node, I don’t think this will affect your error though.

I can’t make out the detail of the polycurves on your image (the image below shows what I think you are trying to make, correct me if I’m wrong), but your bend radii are possibly too small. If you don’t have any radii on the bends and they are just two straight lines meeting at 90 degrees (top in image), the node won’t be able to make the bars (however, you’ll get a different error, and not the internal error warning). Also, if you do have radii at the 90 degree bends, but they are smaller than the standard bend radius, the node also won’t be able to make the bars (but again, this will give you a different error).

Remember that the standard bend diameters are inside diameters and that you are drawing the bar center lines, so you have to adjust your radii accordingly (eg, if you have a 25mm bar, with a standard bend diameter of 155mm, the arcs in your polycurve have to have a diameter of at least 180mm, or the rebar creation node will fail).

But as mentioned above, incorrect geometries would cause different errors, your code looks fine, can’t see why you get the internal error.

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/9/9ac6470255399a4fde77e25b6bacb1419f1ea003.png)

If you are trying to create bars with the shape shown in the image, you could just draw the bottom straight section and add 90degree hooks to the ends using the rebar node.

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 29, 2016, 12:39pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/11 "2016-06-29T12:39:05Z")

</div>

Sorry for my late reply, I upgraded to Revit 2014, I was using 2016, but it still does not work but thank you for testing my script

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 29, 2016, 12:55pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/12 "2016-06-29T12:55:25Z")

</div>

I was able to download your Revit file now, the geometry in your file was a little more challenging than the test I did. With that file I get the same error as you.

#Checks:  
The polycurves in Dynamo looks fine though:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/e7677502e58798ef39527ed3b24b3ac6f5e1039d.png)

Looks like they fit inside your host too:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/db8c0a4b4e1c5abfd33d4f06cdbb94017c0e4d75.png)

And the number of polycurves matches the amount of normal vectors:  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/a/a9296036d37eeb691340328230f440d323cb5903.png)

#Error messages:  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/2236dd230cc480aa1b22ab1f59455852b9a020d5.png)

In console: !! Warning: Rebar Container is placed completely outside of its host.

#Suggestion:  
You can try to post and issue here: [https://github.com/tt-acm/DynamoForRebar/issues](https://github.com/tt-acm/DynamoForRebar/issues)  
(attach your files, and warning messages)

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 29, 2016, 1:37pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/13 "2016-06-29T13:37:59Z")

</div>

I tried feeding the Flatten node straight into the PolyCurve.ByJoinedCurves but I get Warning: PolyCurve.ByJoinedCurves operation failed. Curve join produced more than one WIRE in PolyCurve.

The detail of the polycurve looks like the top image in your comment but here is an image of the rebar that is created  
 ![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/9/9a86b973b141a9fcf9f6016edcc95688b96f9d55.png)

The strange thing is that it work for some elements but not others like you can see in the image below,  
I got no error for the element on the left but an internal error for the element on the right

But the problem with the hooks is that I cannot change their length.

Thank you for your answer 🙂

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 29, 2016, 1:38pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/14 "2016-06-29T13:38:47Z")

</div>

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/df10db995d3269877cfd3b29397db79dc78b0093.png)

---

<div class="post-metadata">

**Author:** ![TanyaBryn](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TanyaBryn](https://forum.dynamobim.com/u/TanyaBryn)\
**Post date:** [June 29, 2016, 1:40pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/15 "2016-06-29T13:40:13Z")

</div>

@Einar_Raknes Thank you for taking a look at this for me I will post the issue 🙂

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [August 29, 2017, 1:17pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/16 "2017-08-29T13:17:44Z")

</div>

Sorry for the late reply, but @TanyaBryn, I’ve been experiencing the same issues as described but with other curve shapes. In some cases when the polycurve is straight, I managed to re-create a single curve from the start point and end point, but for polycurves containing more than one line in different directions, “An internal error has ocurred” shows.

Did you already solve that issue?

I’m thinking what @TSF said could be the problem. I’ll give it a try.
