Get "Element" From Key Schedule

I am looking to set a Key Schedule Parameter for Rooms based on their Name.

  1. Collect All Rooms
  2. Check their name against a list
  3. If in the list, apply a specific “Occupancy Group” to them via a Key Schedule Parameter

The problem I have is that I am unable to get a “List” of available Parameters for that Schedule as Elements. I am open to Python and/or nodes just looking for some help here on the Parameter as Element part.
I am getting the Information, just not as Elements to Sort / Filter and Set.
image

Here is what the Key Schedule looks Like
image

Solution to this was found here from @Konrad_K_Sobon from over 4 years ago… I have a long ways to go!

https://forums.autodesk.com/t5/revit-api-forum/key-schedule-revit-api/td-p/5449134

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
viewSchedule = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

elements = FilteredElementCollector(doc, viewSchedule.Id).ToElements()

params = []
names = []
for i in elements:
    params.append(i.Parameters)
    names.append(i.Name)

TransactionManager.Instance.TransactionTaskDone()

OUT = elements, names

While I was at it, I figured why not ZTN it:

3 Likes

This may be of interest to you.

http://dynamobim.org/forums/topic/read-revit-key-parameter-value-set-new-key-parameter-value/

1 Like

Hello Sean,
which node is it ? i mean Revit elements get key schedule elements.

That was a Zero Touch Node I made for my in house package, but the Python code provided should get you to the same place if someone else hasn’t developed a node at this point.

1 Like