# Error when creating rebar following PolyCurves (continued)

**URL:** <https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386>\
**Category:** Packages\
**Tags:** dynamoforrebar\
**Created:** [August 29, 2017, 1:23pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386 "2017-08-29T13:23:00Z")\
**Posts on this page:** 6\
**Page:** 1

<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:23pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386/1 "2017-08-29T13:23:00Z")

</div>

Hi All,

I’m just continuing last year’s thread:

> [@Error when creating rebar following PolyCurves](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/12):
>
> 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: Looks like they fit inside your host too: And the number of polycurves matches the amount of normal vectors: [image] #Error messages: [image] In console: !! Warning: Rebar Container is placed completely outside of its host. #Suggestion: You can try to …

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.

Does anyone experienced the same issue and, the most important, already solved that issue?

I’m thinking what @TSF said could be the problem.

> [@Error when creating rebar following PolyCurves](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves/4754/10):
>
> 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 Flat…

I’ll give it a try.

Thanks in advance!

---

<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:38pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386/2 "2017-08-29T13:38:50Z")

</div>

Following, If I don’t re-create a line from a straight polycurve, it shows the error. **So I don’t think the issue is due to the bend diameter.**

Just to show what I’m trying to do. I’m working on wall displacements, so I manageg to create a bar that recognizes the displacement and detours it’s path:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/acc5d4e62cf375f832989a4a182c9429962065ad.png)

From my script, I get several polycurves that do what I want, but when it comes to create the rebars, the “An internal error has ocurred” shows. In the image you can see the number of curves contained in the polycurves.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/5/4599a837bdaae33c59e1c00671f5416858b3ff2a.png)

So, if I re-create the polycurves it works and **EVEN** it creates the rebar for the polycurve which has more than on e curve into.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8dc974707a4a2475635ac13ce7a4c8e43c12aa2c.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/9/1935bdd7af20c27f2c1bed02d324763697b09a4e.png)

Concluding, my issue is that I can’t re-create the polycurves. In most of the cases I need the polycurves created to do the job. so:

- Why is it working in some cases and in others don’t?

Thanks in advance

---

<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, 3:06pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386/3 "2017-08-29T15:06:18Z")

</div>

I gave a try what @Einar_Raknes suggested in another topic:

> [@Setting rebar container dimensions in Dynamo (Dynamo for Rebar)](https://forum.dynamobim.com/t/setting-rebar-container-dimensions-in-dynamo-dynamo-for-rebar/4438/3):
>
> You can make any rebar shape you like with the Rebar.CreateFromCurves method in the API import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import \* from Autodesk.Revit.DB.Structure import \* clr.AddReference("System") from System.Collections.Generic import List clr.AddReference('RevitNodes') import Revit clr.ImportExtensions(Revit.GeometryConversion) clr.ImportExtensions(Revit.Elements) clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistenc…

and I’m now getting this error:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/0/d0bd9607be05212e08f94bbe825c78381efe1526.png)

It only works with closed Polycurves? Is this equivalent to DynamoforRebar package “An internal error ocurred”?

---

<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, 3:35pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386/4 "2017-08-29T15:35:03Z")

</div>

What does the “The input PolyCurve must be closed” mean? I thought that my policurves had some gaps that the Polycurve.ByJoinedCurves missed, so I created the same polycurve using Polycurve.ByPoints and got the same result:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/c/fcd953767a0f9b8ca65a2dccafe906a816d1d1fb.png)

Any ideas?

---

<div class="post-metadata">

**Author:** ![krishad82](https://avatars.discourse-cdn.com/v4/letter/k/258eb7/32.png) [@krishad82](https://forum.dynamobim.com/u/krishad82)\
**Post date:** [May 24, 2020, 4:08am UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386/5 "2020-05-24T04:08:37Z")

</div>

Have you solved this issue, i am facing the same problem .please help me

---

<div class="post-metadata">

**Author:** ![itamarbrown88](https://avatars.discourse-cdn.com/v4/letter/i/65b543/32.png) [@itamarbrown88](https://forum.dynamobim.com/u/itamarbrown88)\
**Post date:** [May 25, 2022, 11:24pm UTC](https://forum.dynamobim.com/t/error-when-creating-rebar-following-polycurves-continued/14386/6 "2022-05-25T23:24:35Z")

</div>

this is a consistent problem when the curves in each bar are not coplanar and or the normal doesnt match the bars.

basically you want to have a planar rebar with the normal set to the normal of the plane

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/8/c86e9cdaf8b286ab3cb8cedb5310706645014c08.png)

i’m using archi-cad node pull points onto plane, try and work with points as it will make things smoother, but you can implement the same basic idea in other ways and probably with code.  
the same operation failed before using this method  
good luck!
