Need a hand (Array İnput Type)

in this code

"
#Original code from @Einar_Raknes
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB 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

#Converting input from Dynamo to Revit
line = UnwrapElement(IN[0]).GeometryCurve

ref = ReferenceArray()
ref.Append(line.GetEndPointReference(0))
ref.Append(line.GetEndPointReference(1))

#Create the dimension in a transaction
TransactionManager.Instance.EnsureInTransaction(doc)

dim = doc.Create.NewDimension(doc.ActiveView, line, ref)

TransactionManager.Instance.TransactionTaskDone()

OUT = dim
";

the input node accepts only one input what should i need to change to make node accepts list inputs ???

i know the question is too simple but i may get permision to work on python with this node

You have a few options. You can modify the input line of code a little bit and add a for loop.

items = UnwrapElement(IN[0])

for item in items:
     line = item.GeometryCurve

Or you can wrap the python code in a custom node (if it’s not already) and set the lacing to Longest. Modifying the code may also require a few more changes to make your list structure work but both are viable options.

1 Like