Setting rebar container dimensions in Dynamo (Dynamo for Rebar)

Hi @Einar_Raknes, could you please explain a bit which vector is using for the normal vector?

I’m getting this error:

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.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

def hookOrient(dir):
	if dir=="Right":
		return RebarHookOrientation.Right
	elif dir=="Left":
		return RebarHookOrientation.Left
	else: return "Wrong input"

#Converting input from Dynamo to Revit
style = RebarStyle.Standard
barType = UnwrapElement(IN[0])
startHook = IN[1]
endHook = UnwrapElement(IN[2])
host = UnwrapElement(IN[3])
norm = IN[4].ToXyz()
curves=List[Curve]([c.ToRevitType(True) for c in IN[5]])
startHookOrient = hookOrient(IN[6])
endHookOrient = hookOrient(IN[7])
useExistingShapeIfPossible = 1
createNewShape = 0

#create rebar in  transaction
TransactionManager.Instance.EnsureInTransaction(doc)

rebar = Rebar.CreateFromCurves(doc,style,barType,startHook,endHook,host,norm,curves,startHookOrient,endHookOrient,useExistingShapeIfPossible,createNewShape)
TransactionManager.Instance.TransactionTaskDone()

#Wrapping rebar object, if set to True a new rebar element will be created each time
OUT = rebar.ToDSType(False)