Create RebarFromCurves error

Hi Everyone,

Could you guys please help me out with this error?

It seem like, I put all the correct inputs, but somehow Dynamo can not generate the Rebar… :frowning:

Dynamo_Rebar_ByCurve.py (1.8 KB)

image

Here is the script:

import clr
import sys
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript import *
from Autodesk.DesignScript.Geometry import *

Import Element wrapper extension methods

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

from System.Collections.Generic import *

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
import System

host = UnwrapElement(IN[0])

curves = IN[1]

xyz = XYZ(0,1,0)

style = Autodesk.Revit.DB.Structure.RebarStyle.Standard
rebartype = UnwrapElement(IN[2])
rebarhooktype_start = UnwrapElement(IN[3])
rebarhooktype_end = UnwrapElement(IN[4])

TransactionManager.Instance.EnsureInTransaction(doc)

newrebar = Rebar.CreateFromCurves(doc, style, rebartype, rebarhooktype_start, rebarhooktype_end, host, xyz, curves, RebarHookOrientation.Right, RebarHookOrientation.Left, True, True)

TransactionManager.Instance.TransactionTaskDone()

OUT = newrebar

I’m probably not going to be able to solve this anyway, but you’re better off actually posting the script here.

thanks you for quick respond, please have a look to the script above.