I really appreciate your help,
You are right i just replaced the positions of vectors and rebars, and when i fixed that the code worked fine.
but after i faced another issue, I am trying to create rebars with L shape but the i got error that the polycurve must be a closed shape but i did not it to be closed shape.
Canât comment on âwhyâ without seeing the code, but my guess is that you have a normal misoriented. Might be best to take the normal of the polycurve here rather than providing your own. Also best to move into ONE python node not many, or start using custom nodes as theyâll facilitate management.
Iâve got minimal time today, but I can give it a shot if you can post the graph and a dataset to replicate the issue. Any newmodel with two elements to host rebar and the required rebar types and such setup should suffice.
@jacob.small
Kindly find my Script and Revit file to have a look clearly.
I create the same issue with one element for one rebar only.
Hope to hear your opinion soon.
Thanks in advance.
@c.poupin Thanks for your response, i really appreciate.
The code work perfect, but actually i am looking to :
1- Add vectors to these bars so i can use MaxSpacing function to them after that.
2- Make the code handle both cases if the bar is single curve or PolyCurve.
Sounds like what you are after may already be managed via the rebar tools in some of the Revir Structural teamâs Dynamo packages. Any reason you are doing this in Python?
What i meant was to ask u that did u add the hook as well into the curve and i checked your script u did add the hook into it which is not meant to be added instead Dynamo curves that define the shape of the rebar curve and must belong to the plane defined by the normal and origin. Bends and hooks should not be included in the curve definition
Itâll resolve the issue and youâll be able to do what u are after.
As here u can see this is method CreateFromCurves Method (revitapidocs.com) You have the option to set the RebarHookOrientation but if say you donât wanna use this method and want to keep the hook as well in your curve then please proceed with this method CreateFromCurves Method (revitapidocs.com) This method allows you to keep the hooks as well into the shape definition.