Command Palette

Search for a command to run...

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

pyrevit-library

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

Map of the shared Python libraries every script can import, pyrevitlib (pyrevit.revit) and rpw, and how to find a function in them. Read it before writing raw…

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

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

pyrevitlib and rpw

pyRevit ships two maintained libraries that agent scripts can import on every engine. Use them first: their functions handle version differences, engine quirks and the Revit API traps agents fall into. Write raw DB. code only for what they don't cover.

Finding a function

lookup_pyrevit_api searches both libraries from their source, without Revit:

  • lookup_pyrevit_api(query="section box") searches names and docstrings.
  • lookup_pyrevit_api(query="create_gable_roof") returns the signature, the full docstring and the import line.
  • lookup_pyrevit_api(query="pyrevit.revit.db.create") lists a module.
  • list_automation(offset=0, limit=25) lists reviewed APIs with stable IDs, effects, context and transaction requirements. Entries with invocable: true run through run_automation, and most list the inputs they take. Use an ID with lookup_pyrevit_api to read its full contract.
  • run_automation(id=..., inputs=...) runs an invocable operation through the guarded query path, so nothing it does is kept. Pass the listed inputs by name; an element input is an element id number, and an optional input is left out rather than set to null. For example run_automation(id="pyrevit.elements.name", inputs={"element": 316542}) or run_automation(id="pyrevit.sheets.list", inputs={"include_placeholders": false}). List results come back as value with total and truncated. Four operations predate input declarations and take fixed inputs: pyrevit.units.parse-length and pyrevit.units.parse-slope with {"value": ...}, pyrevit.levels.resolve with {"name": ...}, and pyrevit.elements.by-category with {"categories": ["OST_Walls"], "limit": 50}. The document-bound operations require an active document.

When a script fails on a name from these libraries, the error hint lists similar names.

Where things live

from pyrevit import revit
from pyrevit.revit.db import query, create, update
from pyrevit.revit import units, ui
Need Use
Transaction with revit.Transaction("name"): rolls back and re-raises on an exception
Current document, view, selection revit.doc, revit.uidoc, revit.active_view, revit.get_selection()
Levels, types, family types, views by name; raises with the valid names query.find_level, query.find_type(DB.WallType, "name"), query.find_family_symbol("36\" x 84\"", family_name=..., category="OST_Doors") or query.find_family_symbol("Family : 36\" x 84\""), query.find_view, query.find_plan_view(level)
Other lookups (return None or a list when nothing matches) query.get_types_by_class, query.get_family_symbol, query.get_all_views, query.get_view_by_name, query.get_category("OST_Walls"), query.get_elements_by_categories, query.get_param, query.get_sheets, query.get_elements_by_parameter…
Extents query.get_elements_bounding_box(elements), query.get_model_elements()
Walls, floors, ceilings, rooms, room separation, model lines create.create_wall(s), create.create_floor, create.create_ceiling, create.create_room, create.create_room_separation_lines, create.create_model_lines
Roofs create.create_gable_roof, create_hip_roof, create_shed_roof, create_footprint_roof; gable end walls with create.create_gable_wall, or update.attach_wall_tops(walls, roof) where Revit supports wall attachment
Non-rectangular walls create.create_profile_wall(points) from an outline in the wall's vertical plane
Doors, windows, furniture, columns create.place_hosted_instance, create.place_family_instance, create.create_column
Views create.create_plan_view, create_model_3d_view, create_section_view, create_elevation_view
Drawings query.get_face_references(element, direction), create.create_dimension, create.tag_elements, create.create_room_tags, create.create_schedule, create.create_sheet, create.place_on_sheet
View framing and visibility update.set_section_box, update.orient_3d_view, update.set_3d_view_camera, update.crop_view_to_elements, update.set_crop_region, update.hide_non_model_categories, update.hide_categories
Family content (family documents; see family-geometry) create.create_reference_plane, query.get_reference_plane, create.create_labelled_dimension, create.align_faces_to_planes, create.load_family_document, update.set_formula
Navigation ui.request_view_change(view), ui.zoom_to_elements(elements), ui.zoom_fit()
Units units.parse_length("32'-6\"") (feet), units.parse_slope("8:12") (rise over run), units.format_length(value)
Parameters query.get_param(element, name), update.update_param_value(param, value)
Numbers on elements in a view, as markers or a heatmap from pyrevit.revit import avf: avf.show_values(view, {element_or_id: number}, name=..., unit=...) reports what was shown and why anything failed. By default
Полный SKILL.md на GitHub

Установить pyrevit-library в Claude Code и Claude Desktop

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

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

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

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

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

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

Вложенные файлы

revit-utilities.md

FAQ

Что делает скилл pyrevit-library?

Map of the shared Python libraries every script can import, pyrevitlib (pyrevit.revit) and rpw, and how to find a function in them. Read it before writing raw Revit API code for lookups, element or view creation, parameters, units, transactions or navigation.

Как установить скилл pyrevit-library?

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

Скилл pyrevit-library запускает скрипты?

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

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

Сравнить pyrevit-library с