Command Palette

Search for a command to run...

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

views

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

Creating, framing and navigating views. Covers finding views, new plans, 3D views, sections and elevations, section boxes and crops, hiding categories, view…

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

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

Views

Read revit-scripting and pyrevit-library first. The functions below are in pyrevitlib; check any of them with lookup_pyrevit_api.

from pyrevit import revit
from pyrevit.revit.db import query, create, update
from pyrevit.revit import ui

Which tool

Goal Use Approval
See the model or a view as a picture capture_view none
Select, zoom to, or temporarily isolate elements in the active view show_elements none
Open a view, zoom it ui.request_view_change, ui.zoom_to_elements in run_query none
Create a view, or change its settings permanently pyrevitlib view functions in run_modify yes, under policy ask

Don't create a view only to look at something: capture_view(view="3d", elements=[...], direction="southwest") renders a temporary 3D view of model categories, framed on those elements, and leaves nothing behind.

capture_view accepts a view name, a view id, or a sheet number such as A101. A plan with an active crop is exported framed on all its datums, so elevation markers and section lines outside the crop can shrink it; for a framed drawing, capture the sheet the view sits on.

To judge detail-level-dependent content such as families, add detail_level="fine" (or coarse, medium) and display_style (wireframe, hidden_line, shaded, shaded_edges); both apply to this capture only, also on a named view. When a name is shared (a floor plan and a ceiling plan, a view and a sheet), pass view_type such as FloorPlan or CeilingPlan. For a camera of your own, pass eye=[x, y, z] and target=[x, y, z] in feet. For a cut, pass section={"origin": [x, y, z], "normal": [nx, ny, nz], "depth": d}: a horizontal normal is the direction the section looks along, [0, 0, -1] gives a plan cut at the origin's height. All of these stay temporary; don't create a real view just to look.

To see what you just showed the user, call show_elements and then capture_view(mode="viewport"): it renders the active view exactly as zoomed and panned, with the temporary isolate, without depending on the Revit window. Use mode="screen" only when you need the selection highlight, and expect view_obscured if another window covers Revit.

Finding views

  • query.get_all_views(view_types=[DB.ViewType.FloorPlan]) lists views. Filter by type or name; projects have hundreds of views.
  • query.find_view("Level 1") finds one by name or id, and raises with similar names when it's missing. query.find_plan_view(level) finds a floor plan of a level.

Creating views

Run these in run_modify, inside with revit.Transaction("..."):. Names are made unique automatically ("Name (2)").

  • Plan: create.create_plan_view(level="Level 1", view_name="L1 - Furniture", plan_type="floor"). Plan types: floor, ceiling, structural.
  • 3D: create.create_model_3d_view(view_name="House 3D", direction="southeast", elements=None, model_only=True).
    • direction: southeast, southwest, northeast, northwest, south, north, east, west, top.
    • elements frames the section box on those elements; the default frames the whole model.
    • model_only hides levels, grids and annotation. Leave it on: level and grid extents otherwise ruin the framing.
  • Section: create.create_section_view(start, end, view_name=None, bottom=None, top=None, depth=10). It looks to the left of start → end: a line drawn west to east looks north. depth is the far clip in feet.
  • Elevation: create.create_elevation_view(side="south", view_name=None) looks at the whole model from that side. It works with elevation marker types that have one view slot, by rotating the marker. Templates often already have South/North/East/West elevations; reuse them (query.find_view("South")) when they show the model.
  • Template: pass template="<template name>" to any of these. Prefer the project's templates to setting graphics by hand.
  • Sheets: create.create_sheet(...); see the drawings skill.

Framing and visibility

  • update.set_section_box(view3d, elements=None, padding=2) fits a 3D view's section box.
  • update.orient_3d_view(view3d, "northwest"), or update.set_3d_view_camera(view3d, eye, target) with DB.XYZ points.
  • update.crop_view_to_elements(view, elements=None, padding=3) crops a plan, section or elevation to elements (it clears the view's scope box, which would otherwise override the crop); update.set_crop_region(view, curve_loops) sets a non-rectangular crop.
  • update.hide_non_model_categories(view) hides every non-model category.
  • update.hide_categories(view, ["OST_Furniture"]) hides categories permanently; view.HideElements(ids) hides elements. SetCategoryHidden takes a category's Id, not the Category; the function handles that.
  • Scale and detail: view.Scale = 50, view.DetailLevel = DB.ViewDetailLevel.Fine, view.DisplayStyle = DB.DisplayStyle.ShadingWithEdges.

Navigating

  • `ui.request_view_change(
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

FAQ

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

Creating, framing and navigating views. Covers finding views, new plans, 3D views, sections and elevations, section boxes and crops, hiding categories, view templates, opening a view and zooming, and taking a picture of the result. Use it for "make a 3D view of the house", "cut a section through the stair", "show me the kitchen", "open the level 2 plan" and similar tasks.

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

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

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

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

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

Сравнить views с