Ahh so there is no direct way to collect the Departments, I would have to loop through all the rooms to get them, and using a set() makes it so duplicates are eliminated. Nice solution, too bad there isn’t a more efficient way (ie skipping the room collection step).
Also, if a Department was created earlier, but then deleted from all rooms, this method misses collecting that Department value. Maybe there is another way???
You are correct that this would only gather in-use departments. For the deleted departments, can you access that information from anywhere inside the standard user interface?
As far as I can tell it’s just a text parameter, so if the information goes away it’s not in ‘some master list’ elsewhere.
(An example of this master list is the Space Type parameter)
I believe they just added support for color schemes to the API in revit 2022. DB.ColorFillScheme.GetEntries() --> ColorFillSchemeEntry.GetStringValue()
I haven’t really played around with this yet, though.