I’m getting the boundaries of the floors using a Springs Node:
But the problem I have is creating the area boundaries, because it says “expected Curve, got Line”. In principle I’m getting curves… Anyway I’m trying to convert the Lines to Curves but the different solutions I found in the forum don’t work in my script made with python (I’m using Revit 2019). This is my code:
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
view = uidoc.ActiveGraphicalView
test = []
linesList = UnwrapElement(IN[0])
lines = [item for sublist in linesList for subsublist in sublist for item in subsublist]
TransactionManager.Instance.EnsureInTransaction(doc)
levelView = view.GenLevel
plane = SketchPlane.Create(doc, levelView.Id)
for line in lines:
areaBoundary = doc.Create.NewAreaBoundaryLine(plane, line, view)
test.append(areaBoundary)
TransactionManager.Instance.TransactionTaskDone()
OUT = lines
Now I’m trying to create Curves from those (supposed) Lines and I get the following error: ‘Line’ object has no attribute ‘GetEndPoint’. That’s not true:
Thanks a lot! line.ToRevitType() was the solution. I don’t use revit nodes since a few months ago for avoiding problems between versions so usually I write the full code in python and I forgot it (I’m silly): You are using a Revit API method to create the boundary. And from Dynamo you are getting Dynamo objects, not Revit API objects (they are different).