import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB import ElementTransformUtils, ElementId
clr.AddReference("System")
from System.Collections.Generic import List
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
Ids=List[ElementId]()
for i in IN[0]:
Ids.Add(UnwrapElement(i).Id)
TransactionManager.Instance.EnsureInTransaction(doc)
doc.Create.NewGroup(Ids)
TransactionManager.Instance.TransactionTaskDone()
OUT=Ids