I need your help on this code, because I tried to replicate the code for the revit 2021 version and it is not working for me.
The Phyton code is:
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
# Current doc/app/ui
doc = DocumentManager.Instance.CurrentDBDocument
# Define list/unwarp list funtions
def uwlist(input):
resul = input if isinstance(input, list) else [input]
return UnwrapElement(input)
# Preparing input from dynamo to revit
roomset = IN[0]
types = uwlist(IN[1])
levels = uwlist (IN[2])
floors = []
# Do some action in a transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for rm,f,l in zip(roomset,types,levels):
curveloops = []
for crv_setd in rm:
crv_setr = []
for crv_d in crv_setd:
crv_setr.append(crv_d.ToRevitType())
curveloop = CurveLoop.Create(crv_setr)
curveloops.append(curveloop)
flr = Ceiling.Create(doc, curveloops, f.Id, l.Id)
floors.append(flr)
TransactionManager.Instance.TransactionTaskDone()
# Preparing out put to dynamo
OUT = floors
I get the following error:
AttributeError: ‘type’ object has no attribute ‘Create’
I would appreciate if you could help me find a solution or alternative to the version