Revit-CLI vs writing C# against the Revit API
Automating Revit directly means writing C# add-ins against RevitAPI.dll for every task,
while the alternative is repeating clicks in the viewport. Revit-CLI implements the Revit API plumbing once
via a user-space add-in and named pipe: 34 verbs with plain flags, JSON output, UniqueId addressing
and dry-run safety until --apply.
34 verbs · Zero redistributed Autodesk DLLs · 10 tasks compared below
| Task | Revit GUI, by hand | Raw C# Revit API | Revit-CLI |
|---|---|---|---|
| Check .rvt year, build & worksharing | Launch Revit, wait for splash, open File > Info or guess from errors | Reference RevitAPI or write a custom OLE structured storage parser | rvt file-info model.rvt (Ring 0, instant, no Revit needed) |
| Audit active model warnings | Manage > Warnings, expand groups manually, copy-paste to notes | Compile IExternalCommand, call doc.GetWarnings(), group & format JSON | rvt warnings (grouped by severity & cause, <= 9 KB JSON) |
| List elements & read parameters | Filter schedules or click elements one by one in Properties | Write FilteredElementCollector, resolve BuiltInCategory, serialize Parameter | rvt elements --category Walls + rvt params --id <UniqueId> |
| Update parameter safely with preview | Edit in Properties, undo manually if wrong | Open Transaction, handle FailuresPreprocessor, roll back or commit | rvt param-set --id <UID> --param Mark --value W1 (dry-run by default; --apply commits) |
| Create sheets & place viewports | New Sheet > pick titleblock > drag view onto sheet > align | Find FamilySymbol titleblock, ViewSheet.Create, Viewport.Create | rvt sheet-create + rvt view-place --sheet A101 --view "Level 1" --apply |
| Export schedule to CSV | Open schedule > File > Export > Reports > Schedule > pick delimiter | Locate ViewSchedule, configure ViewScheduleExportOptions, call Export | rvt schedule-export --schedule "Door Schedule" --out doors.csv |
| Export PDF / IFC / DWG in background | Open model in UI, wait for views, configure Export dialog | Wire ExternalEvent, PDFExportOptions/IFCExportOptions/DWGExportOptions | rvt export --format pdf --out out.pdf --file model.rvt --headless |
| Cascading purge of unused elements | Manage > Purge Unused > repeat Check All 3-5 times manually | Call GetUnusedElements in a loop across passes inside a Transaction | rvt purge --passes 5 (dry-run preview first, --apply commits) |
| Run model QA rules check | Inspect warnings, unplaced rooms, titleblocks and empty params separately | Write multiple collectors, room area checks, parameter validators | rvt rules-check (single JSON report of warnings, rooms, params & sheets) |
| Generate native .rvt from JSON spec | Model levels, grids, walls, slabs and openings manually | Write 600+ lines of Level.Create, Wall.Create, Floor.Create, NewOpening | rvt building-build spec.json --apply --out model.rvt |
The repetitive cost in raw C# is the plumbing: .addin registration, ExternalEvent
dispatching, modal dialog suppression, Transaction rollback, and bounded JSON output. Paying that
once in one CLI gives every script and AI agent a uniform JSON surface.
Common questions
Why use Revit-CLI instead of writing a custom C# add-in for each task?
Writing raw C# against the Revit API requires a .addin manifest, ExternalEvent marshaling for pipe/async calls, FailuresProcessing dialog guards, Transaction rollback handling, and UniqueId resolution for every script. Revit-CLI packages all 34 verbs once behind a uniform JSON contract.
Can Revit-CLI run unattended without keeping Revit open on screen?
Yes. Pass --file PATH --headless to any Ring 1B/1C verb: rvt launches minimized Revit 2027, opens the background document via OpenDocumentFile, executes the command, and closes cleanly.
Run these verbs on your own Revit 2027 models
Run read-only inspection on any .rvt model before changing a single parameter. Revit-CLI is local and on-premise: zero UAC elevation, zero Autodesk DLLs
redistributed, and every write is a dry run until you pass --apply. Fourteen-day free trial
with e-mail only, no card.
Verb families
- Inspect .rvt headers, IFC files, licenses and cached snapshots offline10 verbs
- Inspect Revit 2027 levels, views, sheets, elements by UniqueId and warnings13 verbs
- Update parameters, swap types, create sheets, place viewports and run batches6 verbs
- Export Revit schedules to CSV, views/sheets to PDF, IFC, DWG and PNG previews3 verbs
- Run BIM QA rules-check and compile declarative cad-building/v1 models to .rvt2 verbs