Command Palette

Search for a command to run...

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

revit-files

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

Revit file types and working with files. Covers what .rvt, .rte, .rfa and .rft files are, where templates and libraries live, and opening documents. Guarded…

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

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

Revit files

File types

Extension What it is Open or create it with
.rvt A project: the building model, its views and sheets. Also used for central and local models of a workshared project; Name.0001.rvt files next to it are backups. app.OpenDocumentFile(path), or uiapp.OpenAndActivateDocument(path) to show it to the user
.rte A project template: the starting settings, types, views and families of a new project. app.NewProjectDocument(path)
.rfa A loadable family: doors, furniture, equipment, fixtures. doc.LoadFamily(path) to load it into a project; app.OpenDocumentFile(path) to read it. A family opened from disk cannot be changed or saved in a guarded run.
.rft A family template: fixes the new family's category and how it is hosted. app.NewFamilyDocument(path)

Text files often travel with them: a type catalog (Door.txt next to Door.rfa) lists the family's types, a shared parameters file defines parameters shared across families and projects (app.SharedParametersFilename), and a keynote file holds keynote text.

app.OpenDocumentFile on a .rte opens the template itself, not a new project. Its PathName is the template's path, and saving it would overwrite the template. For a new project, always use app.NewProjectDocument.

Where templates and libraries live

Read the paths from Revit instead of guessing them:

import os

family_templates = app.FamilyTemplatePath
default_project_template = app.DefaultProjectTemplate
libraries = dict(app.GetLibraryPaths())
generic_model = os.path.join(family_templates, "English", "Metric Generic Model.rft")
  • Family templates sit in a language folder under app.FamilyTemplatePath (English, English-Imperial, ...). The name tells the category and the hosting: Metric Generic Model.rft is unhosted, and there are ... wall based, ... face based, ... ceiling based, ... floor based, ... line based variants, plus templates per category (Metric Door.rft, Metric Electrical Fixture wall based.rft, Metric Duct Elbow.rft, ...). List the folder to see what is installed.
  • Project templates are under %ProgramData%\Autodesk\RVT <version>\Templates\<language>\, for example DefaultMetric.rte, Structural Analysis-DefaultMetric.rte, Mechanical-Default_Metric.rte, Plumbing-Default_Metric.rte, Electrical-Default_Metric.rte, Default-Multi-Discipline_Metric.rte. app.DefaultProjectTemplate is the one the user's Revit starts new projects from.
  • Family libraries: app.GetLibraryPaths(). Recent Revit versions install only part of the library and download the rest on demand, so a family may simply not be on disk. Say so instead of substituting a different category.

Saving: what a run can and can't do

  • Guarded runs cannot save documents. The host blocks Save and SaveAs for documents that were open, created, or opened from disk during a run. It also closes background documents it created or opened without saving when the run ends. Use a run to inspect or prepare a document, then have the user save it in Revit after the run.
  • The document that was open when the run started can't be saved from a run. Revit refuses with "Operation is not permitted when there is any open transaction phase started by API client", because the run holds a transaction group on it. Ask the user to save it in Revit.
  • Revit exports go to export_dir. Document.Export and Document.ExportImage work in any run mode when they target the run's export_dir; any other target is cancelled. To use a subfolder, create it first with os.makedirs: Revit fails with "The folder does not exist" otherwise. Background exports (PDFExportOptions.SetExportInBackground(True), Revit 2025 and later) are cancelled too, because their files arrive after the run; export synchronously. Other APIs that write files, such as ViewSchedule.Export, are not checked, so point them at export_dir yourself. The response lists the files in exports. An export shows the model as the script had it at that moment, and the files stay even when the run's changes are rolled back or declined, so export from the state you want the user to get.
  • Exported files are temporary. Run records, exports included, 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. Tell the user so when you give them the paths, and offer to copy the deliverables to a folder they name: with your own file tools after the run, or by asking the user to copy them. Never write to the user's folders from the script.
  • Files written during a dry run stay on disk. A dry run rolls back model changes, not files. That includes files from APIs the host doesn't block, such as ViewSchedule.Export, shared parameter file edits and TransmissionData.WriteTransmissionData.
  • **Check cleanup
Полный SKILL.md на GitHub

Установить revit-files в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл revit-files?

Revit file types and working with files. Covers what .rvt, .rte, .rfa and .rft files are, where templates and libraries live, and opening documents. Guarded runs cancel the save and print operations Revit lets them cancel, and `Document.Export`/`ExportImage` targets outside the run's `export_dir`. Use it for "open this model", "find the mechanical template", and similar tasks.

Как установить скилл revit-files?

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

Скилл revit-files запускает скрипты?

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

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

Сравнить revit-files с