Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scheduling

БесплатноБез исполняемых скриптовНе проверен

Schedules and quantities. Covers creating schedules, adding fields, filters, sorting and grouping, reading schedule contents, placing schedules on sheets, and…

pyrevitlabsот pyrevitlabs★ 2 094 звезды на GitHub

Об этом скилле

Scheduling

Read revit-scripting first. Check API names with lookup_revit_api.

Answering a quantity question

A run_query over the elements is usually more reliable and faster than building a schedule and reading it back. Build a schedule when the user wants one in the model.

Creating a schedule

cat_id = DB.Category.GetCategory(doc, DB.BuiltInCategory.OST_Doors).Id
schedule = DB.ViewSchedule.CreateSchedule(doc, cat_id)
schedule.Name = "Door Schedule"
definition = schedule.Definition
  • Other kinds: key schedules DB.ViewSchedule.CreateKeySchedule(doc, cat_id), material takeoffs CreateMaterialTakeoff(doc, cat_id), sheet lists CreateSheetList(doc).

Fields

fields = {}
for sf in definition.GetSchedulableFields():
    fields[sf.GetName(doc)] = sf
mark = definition.AddField(fields["Mark"])
width = definition.AddField(fields["Width"])
  • Available fields: GetSchedulableFields() lists what can be scheduled for that category. Its display names are localized, so discover them in the active Revit session instead of hardcoding English labels. Creating a schedule needs a transaction, so in run_query open one and roll it back: t = DB.Transaction(doc, "probe"); t.Start(); ...; names = [sf.GetName(doc) for sf in definition.GetSchedulableFields()]; t.RollBack().
  • Field ids: AddField returns a ScheduleField. Its FieldId is what filters and sorting use.
  • Order: fields appear in the order they are added.
  • Hiding a field: set field.IsHidden = True to keep it for filtering or sorting but not show it.

Filters, sorting, grouping, totals

definition.AddFilter(DB.ScheduleFilter(level.FieldId, DB.ScheduleFilterType.Equal, "Level 1"))
definition.AddSortGroupField(DB.ScheduleSortGroupField(mark.FieldId))
definition.IsItemized = False
definition.ShowGrandTotal = True
  • Grouping identical rows: definition.IsItemized = False merges rows with the same values; True lists every element.

  • Filter values must match the field's storage type: a string, a double in feet, an int, or an ElementId.

  • Headers and footers: grouping headers and footers are properties of ScheduleSortGroupField (ShowHeader, ShowFooter).

Reading schedule contents

table = schedule.GetTableData()
body = table.GetSectionData(DB.SectionType.Body)
rows = []
for r in range(body.NumberOfRows):
    rows.append([schedule.GetCellText(DB.SectionType.Body, r, c) for c in range(body.NumberOfColumns)])
result = rows

The first body rows can be column headers, depending on the schedule's settings.

Placing on a sheet

DB.ScheduleSheetInstance.Create(doc, sheet.Id, schedule.Id, DB.XYZ(x, y, 0))
  • Sheet coordinates are in feet, measured from the sheet origin.

Exporting

To get data out, read the cells with GetCellText as above. To write a file, export it into the run's export_dir, for example schedule.Export(export_dir, "Door Schedule.txt", DB.ViewScheduleExportOptions()). The host doesn't check ViewSchedule.Export, so never point it at the user's folders, and the file it writes stays on disk even when the run later fails or is rolled back. Export only when the user asked for a file, and only after the change that produces the schedule has committed. Files in export_dir last at least 14 days, and after that any host start or later recorded run, including one in another Revit instance, may delete them, even while this Revit session stays open. Give the user the file's path, say it is temporary, and offer to copy it to a folder they name, with your own file tools after the run or by asking the user to copy it.

Before you report done

  • The schedule's rows, read back, match a direct element query of the same category and filters.
  • Its fields, filters, sorting and totals, read back from schedule.Definition, are the ones asked for.
  • capture_view(view="Door Schedule") shows how it looks; it renders the schedule on a temporary sheet that is rolled back.
  • You told the user the schedule's name and the path of any file you exported, and that the file is temporary.
Полный SKILL.md на GitHub

Установить scheduling в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл scheduling?

Schedules and quantities. Covers creating schedules, adding fields, filters, sorting and grouping, reading schedule contents, placing schedules on sheets, and preparing them for export. Use it for "make a door schedule", "count windows by type", "export the room schedule" and similar tasks.

Как установить скилл scheduling?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scheduling запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить scheduling с