I feel I’m close on this. As is, I get this error;
Commenting out the “footprintRoof” Iine gets me this;
I don’t understand why the value is null in that final line given that all of the components return values. Maybe the DB.Line in the List?
I’m still really new to Python so it could very well be something ovious.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from clr import StrongBox
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
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
outline = IN[0]
level = UnwrapElement(IN[1])
roofType = UnwrapElement(IN[2])
TransactionManager.Instance.EnsureInTransaction(doc)
for o in outline:
loop = CurveArray()
loop.Append(o.ToRevitType())
footprint=loop
footPrintToModelCurveMapping = StrongBox[ModelCurveArray]()
footprintRoof = doc.Create.NewFootPrintRoof(footprint, level, roofType, footPrintToModelCurveMapping )
TransactionManager.Instance.TransactionTaskDone()
OUT =footprint, level, roofType, footPrintToModelCurveMapping
Thanks.