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:
- Parse business intent: break down the user's vague requirement into concrete technical concepts.
- Example: "implement DMU" → Dynamic Model Update mechanism → requires the
IUpdaterinterface,UpdaterRegistryclass - Example: "link update phase" → load/update events of Revit linked documents → requires
LinkedFileStatus、RevitLinkType、TransmissionData
- Example: "implement DMU" → Dynamic Model Update mechanism → requires the
-
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" -
Extract keyword list: extract 2-5 concrete class names/interface names/method names from the search results as input for subsequent lookups.
-
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)
- Search to locate first:
python scripts/search_api.py search "关键词"
- View the class member overview:
python scripts/search_api.py class "Autodesk.Revit.DB.ClassName"
- When complete documentation is needed (signatures, Remarks, inheritance chain):
python scripts/extract_page.py --type "Autodesk.Revit.DB.ClassName"
- 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"
- When the
membercommand 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
- List all namespaces:
python scripts/search_api.py namespaces
- View the type list of a specific namespace:
python scripts/search_api.py namespace "Autodesk.Revit.DB"
- Or read directly references/namespace-overview.md Get full navigation.
Path C: Find member ownership
- Search member names across classes:
python scripts/search_api.py member "GetParameters"
- After locating the target class from the results, follow steps 2-4 of Path A to get details.
Path D: Development mode quick reference
- Read directly references/core-patterns.md, which contains C# code examples for 11 core patterns.
- If you need to further inspect API details involved in the patterns, continue querying via Path A.
Step 3: Organize the answer
- Prioritize showing the API signatures and usage directly relevant to the user's question.
- Include brief code examples (refer to the patterns in core-patterns.md).
- 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, transactionsAutodesk.Revit.UI— User interface: Ribbon, dialogs, selectionAutodesk.Revit.ApplicationServices— Application services: Application, ControlledApplicationAutodesk.Revit.Creation— Factory methods: creating documents, geometric objectsAutodesk.Revit.Attributes— Attribute markers: Transaction, Regeneration
Specialized domains:
DB.Architecture— Architecture: rooms, stairs, railingsDB.Structure— Structure: beams, columns, foundationsDB.Mechanical— HVAC: ducts, equipmentDB.Electrical— Electrical: circuits, panelsDB.Plumbing— Plumbing: pipes, plumbing fixtures
Advanced:
DB.ExtensibleStorage— Custom data storageDB.ExternalService— External services frameworkDB.Events/UI.Events— Event systemDB.DirectContext3D— Custom 3D renderingDB.Visual— Materials and render appearanceAutodesk.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.jsonis generated bybuild_index.pyGenerate extract_page.pysupports--idparameters to directly query member-level documentation (prefixes: T=type, P=property, M=method, E=event)
Script enhancements (v1.1.1)
extract_page.pysupports theOverload:prefix, and can automatically expand to a renderable overload and list all overload IDs.- When
_lookupis missing or incomplete,extract_page.pywill try to infer the namespace from the Help ID and query directlydata/pages/<namespace>.json。 extract_page.pyWhen a query fails, candidate IDs in the same namespace are output to facilitate quick correction of spelling/parameter signatures.search_api.py memberWhen no member matches, it will suggest possible type candidates and alternative commands (class/search)。