Any idea how to change input as a list? Now it only takes 1 item.
You have to loop your in in order to do it for multiple items.
import clr clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager doc = DocumentManager.Instance.CurrentDBDocument elements = UnwrapElement(IN) newname = IN output =  counter = 0 t1 = "Renamed element " t2 = " to " TransactionManager.Instance.EnsureInTransaction(doc) for element in elements: org = element.Name new = element.Symbol.Name = newname[counter] result = t1+org+t2+new output.append(result) counter = counter + 1 TransactionManager.Instance.TransactionTaskDone() #Assign your output to the OUT variable. OUT = output
Thank you! Works like a charm!
but didnt work
I am trying to assign different names (in “newname”) to each element in elements with the code below. Unfortunately, only the last name in “newname” is being assigned to all elements. Seems like I am not able to iterate through one element at a time and assign specific names to them.
TransactionManager.Instance.EnsureInTransaction(doc) for i, element in enumerate(elements): element.Symbol.Name = newname[i] TransactionManager.Instance.TransactionTaskDone()
Any help is very welcome.
Thanks for your time.