CreateFromCurves Method Error

So my next problem is with the code for the method “CreateFromCurves”, here is the warning that I get:
“Warning: TypeError : No method matches given arguments for CreateFromCurves: (<class ‘Autodesk.Revit.DB.Document’>, <class ‘int’>, <class ‘NoneType’>, <class ‘Autodesk.Revit.DB.Structure.RebarHookType’>, <class ‘Autodesk.Revit.DB.Structure.RebarHookType’>, <class ‘Autodesk.Revit.DB.FamilyInstance’>, <class ‘Autodesk.Revit.DB.XYZ’>, <class ‘str’>, <class ‘str’>, <class ‘list’>, <class ‘bool’>, <class ‘bool’>) [’ File “”, line 40, in \n’]”

Can it be that it doesn’t recognize the method or the inputs?

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI 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.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
curves = UnwrapElement(IN[0])
rebarStyle = UnwrapElement(IN[1])
rebarType = IN[2]
hookType = UnwrapElement(IN[3])
hookOrientation = UnwrapElement(IN[4])
host = UnwrapElement(IN[5])
vector = IN[6][0].ToXyz()


#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

newRebar = Rebar.CreateFromCurves(doc, rebarStyle, hookType, hookType, host, vector, hookOrientation, hookOrientation, hookOrientation, True, True)

TransactionManager.Instance.TransactionTaskDone()

OUT = newRebar

#revitapi #createrebar #createfromcurveserror #createstirruprebar

I managed to get around the .NET List casting of the curves problem but I am still getting the following warning:
“Warning: TypeError : No method matches given arguments for CreateFromCurves: (<class ‘Autodesk.Revit.DB.Document’>, <class ‘int’>, <class ‘Autodesk.Revit.DB.Structure.RebarHookType’>, <class ‘Autodesk.Revit.DB.Structure.RebarHookType’>, <class ‘Autodesk.Revit.DB.FamilyInstance’>, <class ‘Autodesk.Revit.DB.XYZ’>, <class ‘System.Collections.Generic.0, Culture=neutral, PublicKeyToken=null]]’>, <class ‘str’>, <class ‘str’>, <class ‘str’>, <class ‘bool’>, <class ‘bool’>) [’ File “”, line 40, in \n’]”

Any ideas? I know for sure that the method reads some of the objects in it since I just corrected something at the hookType stage…

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI 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.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
curves = [curve.ToRevitType() for curve in IN[0]]
rebarStyle = IN[1]
rebarType = UnwrapElement(IN[2])
hookType = UnwrapElement(IN[3])
hookOrientation = IN[4]
host = UnwrapElement(IN[5])
vector = IN[6][0].ToXyz()

DBcurves = List[Curve](curves)

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

newRebar = Rebar.CreateFromCurves(doc, RebarStyle.StirrupTie, hookType, hookType, host, vector, DBcurves, hookOrientation, hookOrientation, hookOrientation, True, True)

TransactionManager.Instance.TransactionTaskDone()

OUT = newRebar

You have missing RebarBarType in yours arguments and there’s an argument too manyRebarHookOrientation

I must have mist that throughout the times I tried to get it right. I corrected that mistake and have the twelve suiting inputs and I am still receiving the same warning:
“Warning: TypeError : No method matches given arguments for CreateFromCurves: (<class ‘Autodesk.Revit.DB.Document’>, <class ‘int’>, <class ‘Revit.Elements.ElementType’>, <class ‘Autodesk.Revit.DB.Structure.RebarHookType’>, <class ‘Autodesk.Revit.DB.Structure.RebarHookType’>, <class ‘Autodesk.Revit.DB.FamilyInstance’>, <class ‘Autodesk.Revit.DB.XYZ’>, <class ‘System.Collections.Generic.0, Culture=neutral, PublicKeyToken=null]]’>, <class ‘str’>, <class ‘str’>, <class ‘bool’>, <class ‘bool’>) [’ File “”, line 40, in \n’]”

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI 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.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
curves = [curve.ToRevitType() for curve in IN[0][0]]
rebarStyle = UnwrapElement(IN[1])
rebarType = UnwrapElement(IN[2])
hookType = UnwrapElement(IN[3])
hookOrientation = UnwrapElement(IN[4])
host = UnwrapElement(IN[5])
vector = IN[6][0].ToXyz()

DBCurves = List[Curve](curves)

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

newRebar = Rebar.CreateFromCurves(doc, RebarStyle.StirrupTie, rebarType, hookType, hookType, host, vector, DBCurves, hookOrientation, hookOrientation, True, True)

#TransactionManager.Instance.TransactionTaskDone()

OUT = newRebar

I’m not sure but the error seems to be related to the PythonNet 2.5 Enumeration issue (see here).

There is an error with IronPython2?

This is the first time I’m getting this error… It is happening also with the python 2 and python 3.
Is it still possible to create a rebar using the CreateFromCurves method?

After sample test, finally works fine, just need to set the RebarStyle inside the python node ( I think there is a problem with this input node)
image

test same as Revit API doc

import clr
import System
from System.Collections.Generic import *
from System.Collections.Generic import IList,List

clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import*
from Autodesk.Revit.DB.Structure import *

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

doc = DocumentManager.Instance.CurrentDBDocument

rebartype = UnwrapElement(IN[0])
hookType = UnwrapElement(IN[1])
rebarstyle = Autodesk.Revit.DB.Structure.RebarStyle.Standard #.StirrupTie
column = UnwrapElement(IN[2])
location = column.Location
origin = location.Point
normal = XYZ(1, 0, 0)

rebarLineEnd = XYZ(origin.X, origin.Y, origin.Z + 9)
rebarLine = Line.CreateBound(origin, rebarLineEnd)

curves = List[Curve]([rebarLine])
TransactionManager.Instance.EnsureInTransaction(doc)
rebar = Rebar.CreateFromCurves(doc, 
                            rebarstyle, 
                            rebartype, 
                            hookType, 
                            hookType, 
                            column, 
                            normal, 
                            curves, 
                            RebarHookOrientation.Right, 
                            RebarHookOrientation.Left, 
                            True, 
                            True)
                            
TransactionManager.Instance.TransactionTaskDone()

OUT = rebar

If you’ll look at my code, you’ll see that in the method CreateFromCurve the input is RebarStyle.StirrupTie and its still not working… I have know idea what to do to make it work…