Dear all,
I am trying to add some code lines to an existing python scrip node from a package to make it work as long lacing. The node that I want to modify is the Group.FromElements one.
This is the Python Script that we find inside the node and that only works by introduce a list of elements a name for the group but not a list sublists and a list of names:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from System.Collections.Generic import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
items = UnwrapElement(IN[0])
ids = list()
rejects = list()
for item in items:
try:
ids.append(item.Id)
except:
rejects.append(item)
items = List[ElementId](ids)
TransactionManager.Instance.EnsureInTransaction(doc)
try:
group = doc.Create.NewGroup(items);
group.GroupType.Name = IN[1]
except:
group = list()
TransactionManager.Instance.TransactionTaskDone()
OUT = (group,rejects)
Any help would be much appreciated.
Best,
Sergio