SuperAPI AI Directory

revit-api

Coding & development

View repository

Updated 10-19 01:10

About this skill

Revit 2026 API Reference

Complete API documentation based on RevitAPI.dll v26.0.4.0, covering 30 namespaces、2724 types。

Lookup Workflow

Step 0: Requirement Pre-Research (mandatory for vague questions)

When the question raised by the userdoes not contain an explicit class name, method name, or namespace(e.g., "implement DMU", "link update phase", "how to listen for model changes", "make a parametric family"), you must complete the pre-research first, then proceed to subsequent lookups.

Judgment criterion: whether the user's question contains a directly searchable Revit API identifier (e.g., IUpdater、DocumentChanged、FilteredElementCollector). If not, perform the following steps:

  1. Parse business intent: break down the user's vague requirement into concrete technical concepts.
    • Example: "implement DMU" → Dynamic Model Update mechanism → requires the IUpdater interface,UpdaterRegistry class
    • Example: "link update phase" → load/update events of Revit linked documents → requires LinkedFileStatus、RevitLinkType、TransmissionData
  1. Web search verification: use WebSearch to search for Revit API + <技术概念> to confirm the core classes and namespaces involved.

    搜索示例:"Revit API Dynamic Model Update IUpdater"
    搜索示例:"Revit API linked file update phase event"
    
  2. Extract keyword list: extract 2-5 concrete class names/interface names/method names from the search results as input for subsequent lookups.

  3. Proceed to Step 1: continue with explicit API identifiers.

Important: do not skip pre-research and answer vague questions directly from experience. Even if you think you know the answer, you must confirm it through pre-research and then verify it against this knowledge base.

Step 1: Determine the question type

Question type Example Execution path
Look up a specific API "How to use class XX", "parameters of method XX" Path A
Browse a namespace "What does namespace XX contain", "classes of module XX" Path B
Find member ownership "Which class has method XX", "where is property XX" Path C
General development question "How to create a wall", "how to use transactions" Path D

Step 2: Execute the corresponding path

Path A: Search for a specific API (most common)

  1. Search to locate first:
python scripts/search_api.py search "关键词"
  1. View the class member overview:
python scripts/search_api.py class "Autodesk.Revit.DB.ClassName"
  1. When complete documentation is needed (signatures, Remarks, inheritance chain):
python scripts/extract_page.py --type "Autodesk.Revit.DB.ClassName"
  1. View member-level details (property/method signatures):
python scripts/extract_page.py --id "P:Autodesk.Revit.DB.Wall.Flipped"
python scripts/extract_page.py --id "M:Autodesk.Revit.DB.Wall.Flip"
python scripts/extract_page.py --id "M:Autodesk.Revit.DB.FilteredElementCollector.#ctor(Autodesk.Revit.DB.Document)"
python scripts/extract_page.py --id "Overload:Autodesk.Revit.DB.FilteredElementCollector.#ctor"
  1. When the member command returns an empty result, first check whether a "type name" was mistaken for a "member name":
python scripts/search_api.py member "FilteredElementCollector"  # 会提示改用 class/search
python scripts/search_api.py class "Autodesk.Revit.DB.FilteredElementCollector"

Path B: Browse a namespace

  1. List all namespaces:
python scripts/search_api.py namespaces
  1. View the type list of a specific namespace:
python scripts/search_api.py namespace "Autodesk.Revit.DB"
  1. Or read directly references/namespace-overview.md Get full navigation.

Path C: Find member ownership

  1. Search member names across classes:
python scripts/search_api.py member "GetParameters"
  1. After locating the target class from the results, follow steps 2-4 of Path A to get details.

Path D: Development mode quick reference

  1. Read directly references/core-patterns.md, which contains C# code examples for 11 core patterns.
  2. If you need to further inspect API details involved in the patterns, continue querying via Path A.

Step 3: Organize the answer

  1. Prioritize showing the API signatures and usage directly relevant to the user's question.
  2. Include brief code examples (refer to the patterns in core-patterns.md).
  3. If there are related classes or methods, add supplementary hints.

Core class quick reference

Class Namespace Purpose
Document DB Current Revit document, the entry point for all operations
Element DB Base class of all model elements
ElementId DB Unique identifier of an element
FilteredElementCollector DB Element query/filter (must-learn)
Transaction DB Transaction management for model modification
Wall DB Wall element
Floor DB Floor element
FamilyInstance DB Family instance (doors, windows, etc.)
FamilySymbol DB Family type definition
Parameter DB Element parameter read/write
XYZ DB 3D coordinate point
Line / Arc / CurveLoop DB Geometric curve
Solid / Face / Edge DB Geometric solid
Level DB Level
View / ViewPlan / View3D DB View
UIApplication UI UI-layer application object
UIDocument UI UI-layer document (selection interaction)
ExternalCommandData UI Command execution context
TaskDialog UI Message dialog
Selection UI.Selection User selection interaction

Namespace navigation

Core (used daily):

  • Autodesk.Revit.DB — Database core: elements, geometry, parameters, transactions
  • Autodesk.Revit.UI — User interface: Ribbon, dialogs, selection
  • Autodesk.Revit.ApplicationServices — Application services: Application, ControlledApplication
  • Autodesk.Revit.Creation — Factory methods: creating documents, geometric objects
  • Autodesk.Revit.Attributes — Attribute markers: Transaction, Regeneration

Specialized domains:

  • DB.Architecture — Architecture: rooms, stairs, railings
  • DB.Structure — Structure: beams, columns, foundations
  • DB.Mechanical — HVAC: ducts, equipment
  • DB.Electrical — Electrical: circuits, panels
  • DB.Plumbing — Plumbing: pipes, plumbing fixtures

Advanced:

  • DB.ExtensibleStorage — Custom data storage
  • DB.ExternalService — External services framework
  • DB.Events / UI.Events — Event system
  • DB.DirectContext3D — Custom 3D rendering
  • DB.Visual — Materials and render appearance
  • Autodesk.Revit.Exceptions — Exception types

Prohibitions

  • It is prohibited to skip the Step 0 preliminary research for vague questions and directly answer API details from memory
  • It is prohibited to guess API names or signatures without search verification; they must be confirmed through preliminary research + script queries
  • It is prohibited to directly edit data/ JSON data files in the directory
  • It is prohibited to provide users with API usage that does not appear in the documentation; if the documentation is insufficient, this should be clearly stated
  • It is prohibited to confuse APIs of different Revit versions; this document only covers Revit 2026 (v26.0.4.0)

Notes

  • All scripts are based on the Python standard library and require no additional dependencies
  • Script paths are relative to this skill directory; use scripts/ Prefix
  • Data is pre-extracted into namespace-based JSON files (data/pages/*.json), no raw HTML needed
  • Index file data/api_index.json is generated by build_index.py Generate
  • extract_page.py supports --id parameters to directly query member-level documentation (prefixes: T=type, P=property, M=method, E=event)

Script enhancements (v1.1.1)

  • extract_page.py supports the Overload: prefix, and can automatically expand to a renderable overload and list all overload IDs.
  • When _lookup is missing or incomplete,extract_page.py will try to infer the namespace from the Help ID and query directly data/pages/<namespace>.json。
  • extract_page.py When a query fails, candidate IDs in the same namespace are output to facilitate quick correction of spelling/parameter signatures.
  • search_api.py member When no member matches, it will suggest possible type candidates and alternative commands (class/search)。