I’m trying to place rooms in a revit file based on the level and UV. I tried to follow the syntax for creating a transaction and unwraping dynamo elements that I found in the migrating to .7 document, but I’m running into an error “Expecting UV, got UV” (on the line that creates the new room). Does anyone know what this error means(code below)?
Thanks,
Nate
import clr
Import RevitAPI
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
Import DocumentManager and TransactionManager
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
Import ToDSType(bool) extension method
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
doc = DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application
TransactionManager.Instance.EnsureInTransaction(doc)
#The inputs to this node will be stored as a list in the IN variable.
levels = IN[0]
uvs = IN[1]
for i in range(len(uvs)):
level=UnwrapElement(levels[i])
uv=UnwrapElement(uvs[i])
roomlist=[]
doccreation = doc.Create
room = doc.Create.NewRoom(level, uv)
roomlist.append(room)
TransactionManager.Instance.TransactionTaskDone()
OUT=roomlist