@christian.stan
it’s strange…does not work for me!!
I’ve not posted the first script where I created rebar curve (in your example you selected the beam edge without offseting it with the cover value)
I made change in my script where I create also the top rebar (with the same error)
below my graph and my two script (curves script, rebars script)
curves script
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
btm_beam_edge = IN[0]
Top_beam_edge = IN[1]
beam_width = IN[2]
cover = IN[3]
Subtract_vector = btm_beam_edge.Direction.Normalized().Scale(cover)
Pt1 = btm_beam_edge.StartPoint.Subtract(Subtract_vector.Reverse())
Pt2 = btm_beam_edge.EndPoint.Subtract(Subtract_vector)
Pt3 = Top_beam_edge.StartPoint.Subtract(Subtract_vector.Reverse())
Pt4 = Top_beam_edge.EndPoint.Subtract(Subtract_vector)
Bottom_rebar = Line.ByStartPointEndPoint(Pt1, Pt2)
Bottom_rebar = Bottom_rebar.Offset(-cover)
Bottom_rebar = Bottom_rebar.Translate(Vector.ByCoordinates(0,0,1).Scale(cover))
Top_rebar = Line.ByStartPointEndPoint(Pt3, Pt4)
Top_rebar = Top_rebar.Offset(-cover)
Top_rebar = Top_rebar.Translate(Vector.ByCoordinates(0,0,-1).Scale(cover))
OUT = Bottom_rebar, Top_rebar
rebars script
import sys
import clr
import math
from System.Collections.Generic import IList, List
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
curve1 = IN[0].ToRevitType()
curve2 = IN[1].ToRevitType()
vect = IN[2].ToRevitType()
host = UnwrapElement(IN[3])
beam_width = IN[4].ToRevitType()
width = beam_width.Length
cover = IN[5]/0.3048
spacing = 0.10/0.3048
Btm_bar_type = UnwrapElement(IN[6])
Top_bar_type = UnwrapElement(IN[7])
ber_Hook_type = UnwrapElement(IN[8])
curv1 = List[Curve]()
curv1.Add(curve1)
curv2 = List[Curve]()
curv2.Add(curve2)
TransactionManager.Instance.EnsureInTransaction(doc)
Btm_rebar = Rebar.CreateFromCurves(doc, RebarStyle.Standard, Btm_bar_type, ber_Hook_type, ber_Hook_type, host, vect, curv1, RebarHookOrientation.Left, RebarHookOrientation.Right, True, False)
Top_rebar = Rebar.CreateFromCurves(doc, RebarStyle.Standard, Top_bar_type, ber_Hook_type, ber_Hook_type, host, vect, curv2, RebarHookOrientation.Left, RebarHookOrientation.Right, True, False)
Btm_rebar.GetShapeDrivenAccessor().SetLayoutAsFixedNumber(math.ceil((width-2*cover)/spacing), width-2*cover, True, True, True)
Top_rebar.GetShapeDrivenAccessor().SetLayoutAsFixedNumber(math.ceil((width-2*cover)/spacing), width-2*cover, True, True, True)
TransactionManager.Instance.TransactionTaskDone()
OUT= Btm_rebar, Top_rebar
Thanks.