pyrevitlabs/pyrevit/drawings

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Producing drawings and blueprints. Covers sheets with title blocks, placing views and schedules on sheets, tags, room tags, dimensions, text, and preparing sheets for PDF export. Use it for "set up sheets", "make a floor plan drawing", "tag all doors", "dimension the walls", "export to PDF" and similar tasks.

Install

npx vskill@latest install pyrevitlabs/pyrevit/drawings

SKILL.md

Drawings (views, sheets, annotation)

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

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

Views

Create, frame and find views with the views skill: create.create_plan_view, create_section_view, create_elevation_view, create_model_3d_view, update.crop_view_to_elements.

  • Settings: view.Scale (for example 48 for 1/4" = 1'-0", 100 for 1:100), view.DetailLevel, view.CropBoxActive.
  • Annotation crop: view.get_Parameter(DB.BuiltInParameter.VIEWER_ANNOTATION_CROP_ACTIVE).Set(1) keeps tags and dimensions inside the crop.
  • Hide what the drawing doesn't need: update.hide_categories(view, ["OST_Levels", "OST_Grids", "OST_Elev", "OST_Sections"]).
  • Templates: prefer the project's templates to setting graphics by hand.

Annotation

Annotation belongs to a view. Pass the plan, not the sheet.

  • Dimensions: create.create_dimension(view, references, axis="x", position=y) draws a chain through the references; axis="x" measures along X with the line at Y = position.
  • Face references: query.get_face_references(wall, DB.XYZ.BasisX.Negate())[0] is the wall's outer face looking west. It works for walls, floors and other host elements.
  • Doors and windows: instance.GetReferences(DB.FamilyInstanceReferenceType.CenterLeftRight).
  • Keep dimension chains in lists of (references, axis, position) and build them in one loop; place the lines outside the model with room between chains.
  • Tags: create.tag_elements(view, elements, offset=1.8, tag_type=None) tags by category. offset moves each tag along the element's facing direction, so window tags sit outside and door tags (negative offset) inside.
  • Room tags: create.create_room_tags(view, rooms=None, tag_type="Room Tag With Area"); without rooms it tags every room visible in the view.
  • Text: DB.TextNote.Create(doc, view.Id, DB.XYZ(x, y, 0), "text", text_type.Id), with a type from OfClass(DB.TextNoteType).

Schedules

create.create_schedule takes the display names returned by GetSchedulableFields(), which are localized by Revit. Discover those names in the current session before creating a schedule; for filters, grouping and formatting, see the scheduling skill.

Sheets

python
titleblock = query.find_family_symbol("D 22 x 34 Horizontal", family_name="D 22 x 34 Horizontal", category="OST_TitleBlocks")
sheet = create.create_sheet("A101", "Floor Plan", titleblock.Id)
create.place_on_sheet(sheet, plan_view, anchor="top_left")
create.place_on_sheet(sheet, schedule, anchor="top_right")
  • Placing: create.place_on_sheet(sheet, view_or_schedule, anchor, margin=0.1) aligns the viewport or schedule to a corner (top_left, top_right, bottom_left, bottom_right) or the center of the title block. margin is in sheet feet (0.1 ft = 1.2 in).
  • One sheet per view: a view can be placed on only one sheet; place_on_sheet raises when it's already on one. Duplicate it (view.Duplicate(DB.ViewDuplicateOption.WithDetailing)) for another. Schedules can repeat.
  • Fit: if the viewport is bigger than the sheet, raise view.Scale or tighten the crop.
  • Title block parameters such as drawn by and date are parameters on the title block instance on the sheet.
  • Re-runnable: delete the previous sheet, view and schedule by number and name before creating them again.

Exporting to PDF

Guarded agent runs block Revit file and view exports. Use a run to prepare sheets and verify them, then have the user export from Revit after the run ends.

Before you report done

  • [ ] capture_view(view="A101") for every new sheet and view shows no viewport outside the title block, no overlapping tags, and no empty view (a view outside its crop box or on the wrong level).
  • [ ] Tag and dimension counts match the element counts you intended.
  • [ ] Each view is on one sheet only; duplicates were made where a view is needed twice.
  • [ ] You told the user which sheets are ready to export from Revit.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pyrevitlabs/pyrevit/drawings/badge)](https://verified-skill.com/skills/pyrevitlabs/pyrevit/drawings)

Something wrong with this skill or its page? Tell us.