Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import clr
  2. clr.AddReference('RevitAPI')
  3. from Autodesk.Revit.DB import *
  4. from Autodesk.Revit.DB import ElementTransformUtils, ElementId
  5.  
  6. clr.AddReference("System")
  7. from System.Collections.Generic import List
  8.  
  9. clr.AddReference("RevitNodes")
  10. import Revit
  11. clr.ImportExtensions(Revit.Elements)
  12.  
  13. clr.AddReference("RevitServices")
  14. import RevitServices
  15. from RevitServices.Persistence import DocumentManager
  16. from RevitServices.Transactions import TransactionManager
  17.  
  18. doc = DocumentManager.Instance.CurrentDBDocument
  19.  
  20. Ids=List[ElementId]()
  21. for i in IN[0]:
  22.     Ids.Add(UnwrapElement(i).Id)
  23.  
  24. TransactionManager.Instance.EnsureInTransaction(doc)
  25. doc.Create.NewGroup(Ids)
  26. TransactionManager.Instance.TransactionTaskDone()
  27. OUT=Ids