For this, the Python would need to be re-written to handle lists.
@Daniel_Woodcock1 has provided this super example here:
A slight tweak as per below is required to get this working for Autodesk.Revit.DB.Reference elements such as these wall faces.
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
def tolist(obj1):
if hasattr(obj1,"__iter__"): return obj1
else: return [obj1]
view = doc.ActiveView
dimLines = tolist(UnwrapElement(IN[0]))
linesToDim = tolist(UnwrapElement(IN[1]))
refArrays = []
outList = []
for lineList in linesToDim:
rArr = ReferenceArray()
for l in lineList:
rArr.Append(l)
refArrays.append(rArr)
TransactionManager.Instance.EnsureInTransaction(doc)
for l,r in zip(dimLines,refArrays):
try:
outList.append(doc.Create.NewDimension(view,l.GeometryCurve,r))
except Exception,e:
outList.append(e.message)
TransactionManager.Instance.TransactionTaskDone()
OUT = outList