Group List sort like treeView

Hi,
I need to group list like in Revit Project Browser treeView. Do you know how to do it?

1 Like

Could you show what is inside the python script?

It’s only a browserOrganization for schedule in project:

import clr

clr.AddReference('RevitAPI')

from Autodesk.Revit.DB import *

clr.AddReference("RevitAPIUI")

from Autodesk.Revit.UI import *

clr.AddReference('ProtoGeometry')

from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitNodes")

import Revit

clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")

import RevitServices

from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

lst = []

lstOut = []

org = BrowserOrganization.GetCurrentBrowserOrganizationForSchedules(doc)

schedules = FilteredElementCollector(doc).OfClass(ViewSchedule)

def split_list (x):

   return [lst[i:i+x] for i in range(0, len(big_list), x)]

for schedule in schedules:

    folderNameList = org.GetFolderItems(schedule.Id)

    for name in folderNameList:

        lst.append(name.Name)

    lst.append(schedule.Name)

OUT = split_list(4)
1 Like