Hi all,
I am trying to merge two custom nodes together; the target is to create a custom node which gives me the ability to create a room with these inputs: Point, Level, Name, Number, Phase.
I copied this script from two different custom nodes as I mentioned; since I am very beginner in scripting so I can’t find where is the problem in this code.
I would love if anyone could help me with this.
Thank you!
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
doccreation = doc.Create
names = IN[0]
numbers = IN[1]
phase = UnwrapElement(IN[2])
uvs =[]
for i in IN[3]:
uvs.append(UnwrapElement(i).ToXyz())
level=UnwrapElement(IN[4])
counter = 0
elementlist = list()
TransactionManager.Instance.EnsureInTransaction(doc)
for item in uvs:
uv=UV(item.X,item.Y)
for name in names:
newroom = doccreation.NewRoom(phase)
newroom.Name = name
newroom.Number = numbers[counter]
elementlist.append(newroom)
counter += 1
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist